Lua/Unit: allow modifying of id field for Lua-only units (fixes #2433)
Celticminstrel recommends restricting this to off-map units until we can be sure changing the ID is safe in all contexts. I don't see why not, though... but this should be enough for the situation described in the bug (a unit made with copy_unit).
This commit is contained in:
parent
64b1ff2292
commit
a012e7f0c3
2 changed files with 2 additions and 0 deletions
|
@ -35,6 +35,7 @@ Version 1.13.10+dev:
|
|||
* Lua API:
|
||||
* New wesnoth.unit_types[].advances_to getter.
|
||||
* New wesnoth.unit_types[].advances_from getter.
|
||||
* unit.id is now a modifiable field for off-map (Lua-only) units.
|
||||
* Multiplayer:
|
||||
* Dark Forecast: Fixed broken faction and leader selection.
|
||||
* Rename the Khalifate to Dunefolk.
|
||||
|
|
|
@ -431,6 +431,7 @@ static int impl_unit_set(lua_State *L)
|
|||
map_location loc = u.get_location();
|
||||
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));
|
||||
}
|
||||
|
||||
std::string err_msg = "unknown modifiable property of unit: ";
|
||||
|
|
Loading…
Add table
Reference in a new issue