Expose Units::getSquadName to lua

develop
lethosor 2016-02-25 15:19:35 -05:00
parent 297bbd6f20
commit 3e44aabf12
2 changed files with 2 additions and 0 deletions

@ -1531,6 +1531,7 @@ static const LuaWrapper::FunctionReg dfhack_units_module[] = {
WRAPM(Units, getCasteProfessionName), WRAPM(Units, getCasteProfessionName),
WRAPM(Units, getProfessionColor), WRAPM(Units, getProfessionColor),
WRAPM(Units, getCasteProfessionColor), WRAPM(Units, getCasteProfessionColor),
WRAPM(Units, getSquadName),
WRAPM(Units, isWar), WRAPM(Units, isWar),
WRAPM(Units, isHunter), WRAPM(Units, isHunter),
WRAPM(Units, isAvailableForAdoption), WRAPM(Units, isAvailableForAdoption),

@ -1799,6 +1799,7 @@ int8_t Units::getCasteProfessionColor(int race, int casteid, df::profession pid)
std::string Units::getSquadName(df::unit *unit) std::string Units::getSquadName(df::unit *unit)
{ {
CHECK_NULL_POINTER(unit);
if (unit->military.squad_id == -1) if (unit->military.squad_id == -1)
return ""; return "";
df::squad *squad = df::squad::find(unit->military.squad_id); df::squad *squad = df::squad::find(unit->military.squad_id);