allow getting the PlayerType via GetUnitVariable

This commit is contained in:
Tim Felgentreff 2015-09-17 11:07:11 +02:00
parent e052eb38b5
commit 94ec3ca1ae

View file

@ -1097,6 +1097,8 @@ static int CclGetUnitVariable(lua_State *l)
lua_pushnumber(l, unit->CurrentResource);
} else if (!strcmp(value, "Name")) {
lua_pushstring(l, unit->Type->Name.c_str());
} else if (!strcmp(value, "PlayerType")) {
lua_pushinteger(l, unit->Player->Type);
} else {
int index = UnitTypeVar.VariableNameLookup[value];// User variables
if (index == -1) {