use symbols.xml

develop
Jeremy Apthorp 2019-12-07 22:41:55 -08:00
parent 910f965838
commit 9a37849603
1 changed files with 12 additions and 4 deletions

@ -541,13 +541,21 @@ string Units::getRaceName(df::unit* unit)
return getRaceNameById(unit->race); return getRaceNameById(unit->race);
} }
typedef void (*df_unit_desc_fn)(df::unit*, std::string*); typedef void (*df_unit_physical_description_fn)(df::unit*, string*);
static df_unit_desc_fn df_unit_desc = reinterpret_cast<df_unit_desc_fn>(0x100cbb890); void df_unit_physical_description(df::unit* unit, string* out_str)
{
static df_unit_physical_description_fn fn =
reinterpret_cast<df_unit_physical_description_fn>(
Core::getInstance().vinfo->getAddress("unit_physical_description"));
if (fn)
fn(unit, out_str);
}
string Units::getDescription(df::unit* unit) string Units::getDescription(df::unit* unit)
{ {
CHECK_NULL_POINTER(unit); CHECK_NULL_POINTER(unit);
std::string str; string str;
df_unit_desc(unit, &str); df_unit_physical_description(unit, &str);
return str; return str;
} }