Fixup lua unit.upkeep getter (#1816)

This commit is contained in:
Jeffrey 'Sigurd' Westcoat 2017-06-23 20:19:33 -04:00 committed by Celtic Minstrel
parent f380b154d4
commit 6aada966d3

View file

@ -416,9 +416,9 @@ static int impl_unit_set(lua_State *L)
return 0;
}
const char* v = luaL_checkstring(L, 3);
if(strcmp(m, "loyal") == 0) {
if((strcmp(v, "loyal") == 0) || (strcmp(v, "free") == 0)) {
u.set_upkeep(unit::upkeep_loyal());
} else if(strcmp(m, "full") == 0) {
} else if(strcmp(v, "full") == 0) {
u.set_upkeep(unit::upkeep_full());
} else {
std::string err_msg = "unknown upkeep value of unit: ";