Skip to content

Commit

Permalink
Replace instances of deprecated get/set_variable
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Nov 13, 2019
1 parent 36dc320 commit 7e6c173
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Expand Up @@ -334,7 +334,7 @@

# this code is a handler in case this scenario is reached via debug or an old save which did not include this variable
[lua]
code = << if wesnoth.get_variable("S7_turns")==nil then wesnoth.set_variable("S7_turns",5) end >>
code = << if wml.variables["S7_turns"] == nil then wml.variables["S7_turns"] = 5 end >>
[/lua]

[set_variable]
Expand Down
8 changes: 4 additions & 4 deletions data/campaigns/Legend_of_Wesmere/lua/wml_tags.lua
Expand Up @@ -59,7 +59,7 @@ function wesnoth.wml_actions.replace_map_section(cfg)
end

function wesnoth.wml_actions.unstore_left_behind_units(cfg)
if wesnoth.get_variable("l3_store_kalenz") ~= nil then
if wml.variables["l3_store_kalenz"] ~= nil then
l3_store_kalenz = helper.get_variable_array("l3_store_kalenz")
for i,_ in ipairs(l3_store_kalenz) do
var_name = "l3_store_kalenz[" .. tostring(i-1) .. "]"
Expand All @@ -69,9 +69,9 @@ function wesnoth.wml_actions.unstore_left_behind_units(cfg)
y = "recall"
}
end
wesnoth.set_variable("l3_store_kalenz",nil)
wml.variables["l3_store_kalenz"] = nil
end
if wesnoth.get_variable("l3_store_landar") ~= nil then
if wml.variables["l3_store_landar"] ~= nil then
l3_store_landar = helper.get_variable_array("l3_store_landar")
for i,_ in ipairs(l3_store_landar) do
var_name = "l3_store_landar[" .. tostring(i-1) .. "]"
Expand All @@ -81,7 +81,7 @@ function wesnoth.wml_actions.unstore_left_behind_units(cfg)
y = "recall"
}
end
wesnoth.set_variable("l3_store_landar",nil)
wml.variables["l3_store_landar"] = nil
end
end

Expand Down
Expand Up @@ -137,7 +137,7 @@ while zombies[zArrayIndex] and zExists == false do
zArrayIndex = zArrayIndex + 1
end

wesnoth.set_variable( "recruitedZombieType", "cancel" ) -- default value
wml.variables["recruitedZombieType"] = "cancel" -- default value

if zExists==false then
wesnoth.show_message_box("", _ "There are no corpses available.", "")
Expand All @@ -146,7 +146,7 @@ else
if returned ~= -2 and sides[1].gold < recruitCost then
wesnoth.show_message_box("", _ "You do not have enough gold to recruit that unit", "")
elseif returned ~= -2 and (sides[1].gold ) >= recruitCost then
wesnoth.set_variable( "recruitedZombieType", recruitedType )
wesnoth.set_variable( "recruitedZombieCost", recruitCost )
wml.variables["recruitedZombieType"] = recruitedType
wml.variables["recruitedZombieCost"] = recruitCost
end
end
Expand Up @@ -274,7 +274,7 @@
first_time_only=no
# Determine which side has the advantage
[lua]
code = << wesnoth.set_variable( "result", wesnoth.require("campaigns/Wings_of_Victory/lua/lua.lua").turns_over_advantage() ) >>
code = << wesnoth.wml.variables["result"] = wesnoth.require("campaigns/Wings_of_Victory/lua/lua.lua").turns_over_advantage() >>
[/lua]
[switch]
variable=result
Expand Down

0 comments on commit 7e6c173

Please sign in to comment.