Yes, that seems to be broken. It was changed by softcoder in
0ead6a36. As an aside,
git blame makes it easy to figure out where a specific line of code changed.
Here's the relevant function:
const string World::getUnitName(int unitId) {
Unit* unit= findUnitById(unitId);
if(unit == NULL) {
throw megaglest_runtime_error("Can not find Faction unit to get position unitId = " + intToStr(unitId),true);
}
return unit->getFullName(game->showTranslatedTechTree());
}
This is what it used to be:
const string World::getUnitName(int unitId) {
Unit* unit= findUnitById(unitId);
if(unit == NULL) {
throw megaglest_runtime_error("Can not find Faction unit to get position unitId = " + intToStr(unitId),true);
}
return unit->getFullName();
}
As an aside, I haven't checked if the function is used elsewhere.
This is probably unintentional, since it prevents easy checking for what unit an ID corresponds to (eg, what type was the last unit that died?). Not to mention most of the changes in the
revision in question are using the non-translated versions. However, I do think we need some way to get the translated value for output (since scenarios can be translated).