Add a few more attributes to the [modify_unit] optimized path
This commit is contained in:
parent
2cc7fe6450
commit
1f36590e80
3 changed files with 12 additions and 0 deletions
|
@ -49,6 +49,7 @@
|
|||
* New wesnoth.units.find gets units on either the map or any side's recall list.
|
||||
* Moved to interface module: wesnoth.scroll, wesnoth.zoom, wesnoth.get_mouseover_tile
|
||||
* wesnoth.interface.get_displayed_unit aliased to wesnoth.unit.get_hovered
|
||||
* unit portrait is now writable
|
||||
### WML engine
|
||||
* Support upkeep in StandardUnitFilter
|
||||
* [effect]apply_to=variation now supports heal_full
|
||||
|
|
|
@ -53,6 +53,10 @@ local known_attributes = make_set {
|
|||
"description",
|
||||
"hidden",
|
||||
"unrenamable",
|
||||
"profile",
|
||||
"zoc",
|
||||
"usage",
|
||||
"upkeep",
|
||||
}
|
||||
|
||||
local known_tags = make_set {
|
||||
|
@ -105,6 +109,9 @@ local function simple_modify_unit(cfg)
|
|||
"max_experience",
|
||||
"resting",
|
||||
"canrecruit",
|
||||
"zoc",
|
||||
"usage",
|
||||
"upkeep",
|
||||
}
|
||||
|
||||
local function handle_unit(u)
|
||||
|
@ -121,6 +128,9 @@ local function simple_modify_unit(cfg)
|
|||
if cfg.ai_special == "guardian" then
|
||||
u.status.guardian = true
|
||||
end
|
||||
if cfg.profile ~= nil then
|
||||
u.portrait = profile
|
||||
end
|
||||
if cfg.unrenamable ~= nil then
|
||||
u.renamable = not cfg.unrenamable
|
||||
end
|
||||
|
|
|
@ -440,6 +440,7 @@ static int impl_unit_set(lua_State *L)
|
|||
modify_bool_attrib("resting", u.set_resting(value));
|
||||
modify_tstring_attrib("name", u.set_name(value));
|
||||
modify_tstring_attrib("description", u.set_unit_description(value));
|
||||
modify_string_attrib("portrait", u.set_big_profile(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));
|
||||
|
|
Loading…
Add table
Reference in a new issue