Skip to content

Commit

Permalink
Fix an error in [for] if step not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Dec 11, 2016
1 parent 3cc386d commit 5fdb73b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions data/lua/wml-flow.lua
Expand Up @@ -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
Expand Down

0 comments on commit 5fdb73b

Please sign in to comment.