[unit_overlay] and [remove_unit_overlay]: added WML error message...
...if image= is missing
This commit is contained in:
parent
ec5549f8f8
commit
bc4594616d
2 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,9 @@
|
|||
Version 1.11.1+svn:
|
||||
* Language and i18n:
|
||||
* Updated translations:
|
||||
* WML engine:
|
||||
* [unit_overlay] and [remove_unit_overlay] now return a more meaningful
|
||||
error message if the image= key is missing
|
||||
|
||||
Version 1.11.1:
|
||||
* AI:
|
||||
|
|
|
@ -374,7 +374,7 @@ function wml_actions.select_unit(cfg)
|
|||
end
|
||||
|
||||
function wml_actions.unit_overlay(cfg)
|
||||
local img = cfg.image
|
||||
local img = cfg.image or helper.wml_error( "[unit_overlay] missing required image= attribute" )
|
||||
for i,u in ipairs(wesnoth.get_units(cfg)) do
|
||||
local ucfg = u.__cfg
|
||||
for w in string.gmatch(ucfg.overlays, "[^%s,][^,]*") do
|
||||
|
@ -388,7 +388,7 @@ function wml_actions.unit_overlay(cfg)
|
|||
end
|
||||
|
||||
function wml_actions.remove_unit_overlay(cfg)
|
||||
local img = cfg.image
|
||||
local img = cfg.image or helper.wml_error( "[remove_unit_overlay] missing required image= attribute" )
|
||||
for i,u in ipairs(wesnoth.get_units(cfg)) do
|
||||
local ucfg = u.__cfg
|
||||
local t = {}
|
||||
|
|
Loading…
Add table
Reference in a new issue