mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-26 15:59:52 +00:00
Fix an error in [for] if step not specified
This commit is contained in:
parent
3cc386d0cd
commit
5fdb73b92f
@ -120,14 +120,16 @@ wesnoth.wml_actions["for"] = function(cfg)
|
||||
local sentinel = loop_lim.last
|
||||
if loop_lim.step then
|
||||
sentinel = sentinel + loop_lim.step
|
||||
if loop_lim.step > 0 then
|
||||
return wesnoth.get_variable(i_var) < sentinel
|
||||
else
|
||||
return wesnoth.get_variable(i_var) > sentinel
|
||||
end
|
||||
elseif loop_lim.last < first then
|
||||
sentinel = sentinel - 1
|
||||
return wesnoth.get_variable(i_var) > sentinel
|
||||
else
|
||||
sentinel = sentinel + 1
|
||||
end
|
||||
if loop_lim.step > 0 then
|
||||
return wesnoth.get_variable(i_var) < sentinel
|
||||
else
|
||||
return wesnoth.get_variable(i_var) > sentinel
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user