fix lua unit.loc and unit.goto
A property cannot returns multiple values, the old code never worked. Also the value returned by unit.loc the getter is now of the same type as taken by the unit.loc getter. this in particular fixes #5098
This commit is contained in:
parent
36cb1cf5e4
commit
2435fc425b
1 changed files with 4 additions and 6 deletions
|
@ -303,14 +303,12 @@ static int impl_unit_get(lua_State *L)
|
|||
return_int_attrib("x", u.get_location().wml_x());
|
||||
return_int_attrib("y", u.get_location().wml_y());
|
||||
if(strcmp(m, "loc") == 0) {
|
||||
lua_pushinteger(L, u.get_location().wml_x());
|
||||
lua_pushinteger(L, u.get_location().wml_y());
|
||||
return 2;
|
||||
luaW_pushlocation(L, u.get_location());
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(m, "goto") == 0) {
|
||||
lua_pushinteger(L, u.get_goto().wml_x());
|
||||
lua_pushinteger(L, u.get_goto().wml_y());
|
||||
return 2;
|
||||
luaW_pushlocation(L, u.get_goto());
|
||||
return 1;
|
||||
}
|
||||
return_int_attrib("side", u.side());
|
||||
return_string_attrib("id", u.id());
|
||||
|
|
Loading…
Add table
Reference in a new issue