Fixed the getprofession behavior in adventure mode. Now it checks for the current adventurer's race instead of the fortress race.

develop
JapaMala 2014-07-02 23:07:24 +05:30
parent 4f9479cce5
commit 516121d4f8
1 changed files with 6 additions and 4 deletions

@ -1406,8 +1406,10 @@ std::string DFHack::Units::getCasteProfessionName(int race, int casteid, df::pro
if (pid < (df::profession)0 || !is_valid_enum_item(pid)) if (pid < (df::profession)0 || !is_valid_enum_item(pid))
return ""; return "";
int16_t current_race = df::global::ui->race_id;
bool use_race_prefix = (race >= 0 && race != df::global::ui->race_id); if (df::global::gamemode && *df::global::gamemode == df::game_mode::ADVENTURE)
current_race = world->units.active[0]->race;
bool use_race_prefix = (race >= 0 && race != current_race);
if (auto creature = df::creature_raw::find(race)) if (auto creature = df::creature_raw::find(race))
{ {