Skip to content

Commit

Permalink
Allow writing to unit.loc on off-map units
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Nov 16, 2019
1 parent c27863b commit feeb579
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/scripting/lua_unit.cpp
Expand Up @@ -488,6 +488,11 @@ static int impl_unit_set(lua_State *L)
modify_int_attrib("x", loc.set_wml_x(value); u.set_location(loc));
modify_int_attrib("y", loc.set_wml_y(value); u.set_location(loc));
modify_string_attrib("id", u.set_id(value));
if(strcmp(m, "loc") == 0) {
luaW_tolocation(L, 3, loc);
u.set_location(loc);
return 0;
}
} else {
const bool is_key_x = strcmp(m, "x") == 0;
const bool is_key_y = strcmp(m, "y") == 0;
Expand Down

0 comments on commit feeb579

Please sign in to comment.