Fix a bunch of broken uses of helper.wml_error

It's deprecated, but here they were broken because helper wasn't even loaded.
This commit is contained in:
Celtic Minstrel 2022-06-10 23:42:18 -04:00
parent e635161957
commit 7f873a0150
4 changed files with 10 additions and 10 deletions

View file

@ -6,12 +6,12 @@ bonus.sceneries = {}
-- places a bonus point on the map.
function wesnoth.wml_actions.wc2_place_bonus(cfg)
local x = cfg.x or helper.wml_error("[wc2_place_bonus] missing required 'x' attribute")
local y = cfg.y or helper.wml_error("[wc2_place_bonus] missing required 'y' attribute")
local scenery = cfg.scenery or helper.wml_error("[wc2_place_bonus] missing required 'scenery' attribute")
local x = cfg.x or wml.error("[wc2_place_bonus] missing required 'x' attribute")
local y = cfg.y or wml.error("[wc2_place_bonus] missing required 'y' attribute")
local scenery = cfg.scenery or wml.error("[wc2_place_bonus] missing required 'scenery' attribute")
local c_scenery = bonus.sceneries[scenery]
if not c_scenery then
helper.wml_error("[wc2_place_bonus] invalid 'scenery' attribute: ".. tostring(scenery))
wml.error("[wc2_place_bonus] invalid 'scenery' attribute: ".. tostring(scenery))
end
local image = c_scenery.image or scenery
bonus.place_item(x, y, image)

View file

@ -9,8 +9,8 @@ local terrain_map = { fungus = "Tt", cave = "Ut", sand = "Dt",
-- for all attacks that match [filter_attack], it add a dublicate fo that attack and modifres is as describes in the [attack] subtag which uses the apply_to=attack syntax
function wesnoth.effects.wc2_optional_attack(u, cfg)
local name_suffix = cfg.name_suffix or helper.wml_error("apply_to=wc2_optional_attack missing required name_suffix= attribute.")
local attack_mod = wml.get_child(cfg, "attack") or helper.wml_error("apply_to=wc2_optional_attack missing required [attack] subtag")
local name_suffix = cfg.name_suffix or wml.error("apply_to=wc2_optional_attack missing required name_suffix= attribute.")
local attack_mod = wml.get_child(cfg, "attack") or wml.error("apply_to=wc2_optional_attack missing required [attack] subtag")
local attacks_to_add = {}
local names = {}
for i = 1, #u.attacks do

View file

@ -89,9 +89,9 @@ function wc2_heroes.place(t, side, x, y, is_commander)
end
function wesnoth.wml_actions.wc2_random_hero(cfg)
local side_num = cfg.side or helper.wml_error("missing side= attribute in [wc2_initial_hero]")
local x = cfg.x or helper.wml_error("missing x= attribute in [wc2_initial_hero]")
local y = cfg.y or helper.wml_error("missing y= attribute in [wc2_initial_hero]")
local side_num = cfg.side or wml.error("missing side= attribute in [wc2_initial_hero]")
local x = cfg.x or wml.error("missing x= attribute in [wc2_initial_hero]")
local y = cfg.y or wml.error("missing y= attribute in [wc2_initial_hero]")
local t = wc2_era.pick_deserter(side_num)
if t == nil then

View file

@ -17,7 +17,7 @@ function random_placement(locs, orig_num_items, min_distance, command)
print("placed only " .. i .. " items")
return
else
helper.wml_error("[random_placement] failed to place items. only " .. i .. " items were placed")
wml.error("[random_placement] failed to place items. only " .. i .. " items were placed")
end
end
local index = mathx.random(size)