validate [screen_fade] required parameters

This commit is contained in:
Toom 2024-07-10 17:59:53 +03:00 committed by Pentarctagon
parent 124cf1ccf0
commit dbbee82d9c

View file

@ -728,8 +728,8 @@ function wml_actions.color_adjust(cfg)
end
function wml_actions.screen_fade(cfg)
local color = {cfg.red or 0, cfg.green or 0, cfg.blue or 0, cfg.alpha}
wesnoth.interface.screen_fade(color, cfg.duration)
local color = {cfg.red or 0, cfg.green or 0, cfg.blue or 0, tonumber(cfg.alpha) or wml.error("invalid alpha in [screen_fade]")}
wesnoth.interface.screen_fade(color, tonumber(cfg.duration) or wml.error("invalid duration in [screen_fade]"))
end
function wml_actions.end_turn(cfg)