Lua code: replace deprecated helper.[gs]et_variable_array() calls
This commit is contained in:
parent
7c137e1a33
commit
3c792fc7d7
5 changed files with 5 additions and 5 deletions
|
@ -46,7 +46,7 @@ function ca_forest_animals_move:execution(cfg)
|
|||
|
||||
-- Get the locations of all the rabbit holes
|
||||
W.store_items { variable = 'holes_wml' }
|
||||
local all_items = H.get_variable_array('holes_wml')
|
||||
local all_items = wml.array_access.get('holes_wml')
|
||||
W.clear_variable { name = 'holes_wml' }
|
||||
|
||||
-- If cfg.rabbit_hole_img is set, only items with that image or halo count as holes
|
||||
|
|
|
@ -19,7 +19,7 @@ function ca_forest_animals_new_rabbit:execution(cfg)
|
|||
|
||||
-- Get the locations of all items on that map (which could be rabbit holes)
|
||||
W.store_items { variable = 'holes_wml' }
|
||||
local all_items = H.get_variable_array('holes_wml')
|
||||
local all_items = wml.array_access.get('holes_wml')
|
||||
W.clear_variable { name = 'holes_wml' }
|
||||
|
||||
-- Eliminate all holes that have an enemy within 'rabbit_enemy_distance' hexes
|
||||
|
|
|
@ -33,7 +33,7 @@ return {
|
|||
moves = "current",
|
||||
variable = "tmp_locs"
|
||||
}
|
||||
attack_locs = H.get_variable_array("tmp_locs")
|
||||
attack_locs = wml.array_access.get("tmp_locs")
|
||||
W.clear_variable { name = "tmp_locs" }
|
||||
if (#attack_locs > 0) then break end
|
||||
end
|
||||
|
|
|
@ -352,7 +352,7 @@ on_event("prestart", function()
|
|||
end
|
||||
return res
|
||||
end
|
||||
helper.set_variable_array("fixed_spawn", {
|
||||
wml.array_access.set("fixed_spawn", {
|
||||
fixed_spawn(1, 15, "Fire Dragon", "Gryphon Master", "Hurricane Drake"),
|
||||
fixed_spawn(5, 1, "Yeti", "Elvish Druid", "Elvish Druid"),
|
||||
fixed_spawn(1, 7, "Lich", "Walking Corpse", "Walking Corpse", "Walking Corpse", "Ghoul", "Soulless", "Walking Corpse", "Walking Corpse", "Walking Corpse"),
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#define ASPECT_NOTIFICATION
|
||||
<<
|
||||
local H = wesnoth.require('helper')
|
||||
local expected = H.get_variable_array('expected')
|
||||
local expected = wml.array_access.get('expected')
|
||||
local aspect = wml.variables['test_attribute']
|
||||
if ai.aspects[aspect] ~= expected[wesnoth.current.turn].value then
|
||||
wml.variables['is_valid'] = false
|
||||
|
|
Loading…
Add table
Reference in a new issue