wesnoth / wesnoth

An open source, turn-based strategy game with a high fantasy theme.
https://www.wesnoth.org/
GNU General Public License v2.0
5.45k stars 998 forks source link

lua error if [endlevel] tag has "music" key #1704

Closed doofus-01 closed 7 years ago

doofus-01 commented 7 years ago

Running BfW 1.13.8+dev d53125e09d, there is now an error when [endlevel] tag has a music key. This did not happen in BfW 1.13.7 (I think, but I might have had a version just before 1.13.7). This commit https://github.com/wesnoth/wesnoth/commit/cbd3c2644c8fd68eab1b136ff9591044086ac068 is probably what did it?

To reproduce, add "music=northerners.ogg" to the victory [endlevel] in _data/campaigns/Heir_To_The_Throne/scenarios/01_The_ElvesBesieged.cfg, and debug move Konrad to the post.

This is the error I get:

error scripting/lua: lua/wml/endlevel.lua:88: bad argument #3 to 'newindex' (table with unnamed indices holding strings expected) stack traceback: [C]: in metamethod 'newindex' lua/wml/endlevel.lua:88: 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>

gfgtdf commented 7 years ago

hmm i wonder where we should publish an addon (1.13.8 lua fixes) on the addon server that contains this fix (and possible other fixes that come up in the future)

doofus-01 commented 7 years ago

Tested with master at 597099abb6, and get very similar error as before:

error scripting/lua: lua/wml/endlevel.lua:89: bad argument #3 to 'newindex' (table with unnamed indices holding strings expected) stack traceback: [C]: in metamethod 'newindex' lua/wml/endlevel.lua:89: 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>

CelticMinstrel commented 7 years ago

...argh, right, utils.split() returns an iterator... >_< Is there a nice way to get a table from an iterator?

doofus-01 commented 7 years ago

I believe this is fixed, I don't have the problem anymore. (Using a40f0d248e, which I think is after your fix.) It looks like I have a button to close this, but what's the policy, do you wish to close it yourself?

CelticMinstrel commented 7 years ago

I have no objection to reporters closing their own bug reports, so feel free to do so next time.