Beautified error message when passing an invalid side attribute to [gold].
(Subsumes patch #1477.)
This commit is contained in:
parent
b6afa49502
commit
6f9986d190
1 changed files with 3 additions and 1 deletions
|
@ -123,7 +123,9 @@ local function wml_message(cfg)
|
|||
end
|
||||
|
||||
local function wml_gold(cfg)
|
||||
local team = wesnoth.get_side(cfg.side or 1)
|
||||
local side = tonumber(cfg.side or 1) or
|
||||
helper.wml_error("[gold] given a noninteger side= attribute.")
|
||||
local team = wesnoth.get_side(side)
|
||||
local amount = tonumber(cfg.amount) or
|
||||
helper.wml_error("[gold] missing required amount= attribute.")
|
||||
team.gold = team.gold + amount
|
||||
|
|
Loading…
Add table
Reference in a new issue