Possible [for] bug, 1.13.8
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Possible [for] bug, 1.13.8
If I understand it right from the wiki, this should be perfectly valid code, iterating from 0 to 3:
But it results in this error:
So I tried adding step=1 in the code, and then it worked fine. According to the wiki, 'step' should default to 1 (or -1, based on 'start' and 'end') so this is a bug?
Code: Select all
[for]
end=3
[do]
< stuff >
[/do]
[/for]
Code: Select all
error scripting/lua: lua/wml-flow.lua:149: attempt to perform arithmetic on a nil value (field 'step')
stack traceback:
lua/wml-flow.lua:149: in local 'cmd'
lua/wml-utils.lua:145: in field 'handle_event_commands'
lua/wml-flow.lua:6: in function <lua/wml-flow.lua:5>
[C]: in field 'fire_event'
lua/wml-tags.lua:146: in local 'cmd'
lua/wml-utils.lua:145: in field 'handle_event_commands'
lua/wml-flow.lua:6: in function <lua/wml-flow.lua:5>
The last few months have been nothing but one big, painful reminder that TIMTLTW.
Creator of Armory Mod, The Rising Underworld, and Voyage of a Drake: an RPG
Creator of Armory Mod, The Rising Underworld, and Voyage of a Drake: an RPG
-
- Inactive Developer
- Posts: 503
- Joined: April 24th, 2016, 4:18 pm
Re: Possible [for] bug, 1.13.8
Try this:
In wesnoth's data/lua/wml-flow.lua change line 102 from
to
and retest.
In wesnoth's data/lua/wml-flow.lua change line 102 from
Code: Select all
if cfg.step then loop_lim.step = cfg_lit.step end
Code: Select all
if cfg.step then loop_lim.step = cfg_lit.step else loop_lim.step = 1 end
I forked real life and now I'm getting merge conflicts.
Re: Possible [for] bug, 1.13.8
That seems to have fixed it, at least for end>start. Thanks!
The last few months have been nothing but one big, painful reminder that TIMTLTW.
Creator of Armory Mod, The Rising Underworld, and Voyage of a Drake: an RPG
Creator of Armory Mod, The Rising Underworld, and Voyage of a Drake: an RPG
-
- Inactive Developer
- Posts: 503
- Joined: April 24th, 2016, 4:18 pm
Re: Possible [for] bug, 1.13.8
OK. If Celtic Minstrel doesn't beat me to it, I'll put together a PR with a more-complete solution.
I forked real life and now I'm getting merge conflicts.
Re: Possible [for] bug, 1.13.8
5fdb73b9 was supposed to fix this exact issue, but I guess he didn't test it?
-
- Inactive Developer
- Posts: 503
- Joined: April 24th, 2016, 4:18 pm
Re: Possible [for] bug, 1.13.8
PR #1812 is the fix above. On reading the code, the case where 'end=-3' should do nothing with the wiki-specified default of 'step=1' so no additional checks seemed to be needed.
I forked real life and now I'm getting merge conflicts.
Re: Possible [for] bug, 1.13.8
original post:
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny