Skip to content

Commit

Permalink
Lua code: replace deprecated helper.[gs]et_variable_array() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsc committed May 14, 2018
1 parent 7c137e1 commit 3c792fc
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion data/ai/micro_ais/cas/ca_forest_animals_move.lua
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion data/ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion data/ai/micro_ais/engines/priority_target_engine.lua
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion data/multiplayer/scenarios/2p_Dark_Forecast.lua
Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion data/test/scenarios/ai/_main.cfg
Expand Up @@ -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
Expand Down

0 comments on commit 3c792fc

Please sign in to comment.