add goto_x/y to unit lua proxy
This commit is contained in:
parent
cfd81d38be
commit
5d267578f4
1 changed files with 11 additions and 0 deletions
|
@ -279,6 +279,11 @@ static int impl_unit_get(lua_State *L)
|
|||
lua_pushinteger(L, u.get_location().wml_y());
|
||||
return 2;
|
||||
}
|
||||
if(strcmp(m, "goto") == 0) {
|
||||
lua_pushinteger(L, u.get_goto().wml_x());
|
||||
lua_pushinteger(L, u.get_goto().wml_y());
|
||||
return 2;
|
||||
}
|
||||
return_int_attrib("side", u.side());
|
||||
return_string_attrib("id", u.id());
|
||||
return_string_attrib("type", u.type_id());
|
||||
|
@ -401,6 +406,7 @@ static int impl_unit_set(lua_State *L)
|
|||
modify_tstring_attrib("name", u.set_name(value));
|
||||
modify_string_attrib("role", u.set_role(value));
|
||||
modify_string_attrib("facing", u.set_facing(map_location::parse_direction(value)));
|
||||
modify_string_attrib("usage", u.set_usage(value));
|
||||
modify_bool_attrib("hidden", u.set_hidden(value));
|
||||
modify_bool_attrib("zoc", u.set_emit_zoc(value));
|
||||
modify_bool_attrib("canrecruit", u.set_can_recruit(value));
|
||||
|
@ -486,6 +492,11 @@ static int impl_unit_set(lua_State *L)
|
|||
}
|
||||
}
|
||||
|
||||
if(strcmp(m, "goto") == 0) {
|
||||
u.set_goto(luaW_checklocation(L, 3));
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string err_msg = "unknown modifiable property of unit: ";
|
||||
err_msg += m;
|
||||
return luaL_argerror(L, 2, err_msg.c_str());
|
||||
|
|
Loading…
Add table
Reference in a new issue