HybridDog / nether-pack

migrated to codeberg
https://codeberg.org/HybridDog/nether-pack
Other
5 stars 8 forks source link

guide.lua:320: bad argument #1 to 'ipairs' (table expected, got string) #6

Closed Megaf closed 6 years ago

Megaf commented 6 years ago
2017-12-20 13:38:08: ERROR[Main]: ModError: Failed to load and run script from /home/minetest/MegafServer/BinMegafServer/bin/../mods/nether-pack/nether/init.lua:
2017-12-20 13:38:08: ERROR[Main]: .../BinMegafServer/bin/../mods/nether-pack/nether/guide.lua:320: bad argument #1 to 'ipairs' (table expected, got string)
2017-12-20 13:38:08: ERROR[Main]: stack traceback:
2017-12-20 13:38:08: ERROR[Main]:       [C]: in function 'ipairs'
2017-12-20 13:38:08: ERROR[Main]:       .../BinMegafServer/bin/../mods/nether-pack/nether/guide.lua:320: in main chunk
2017-12-20 13:38:08: ERROR[Main]:       [C]: in function 'dofile'
2017-12-20 13:38:08: ERROR[Main]:       ...r/BinMegafServer/bin/../mods/nether-pack/nether/init.lua:1019: in main chunk

Testing on Minetest backport-0.4 branch.

paramat commented 6 years ago

Use: local tab = minetest.wrap_text(content, guide_size.fx, true) Needs 3rd argument 'true' to ensure 'tab' is a table. See https://github.com/minetest/minetest/blob/649eef9e4fe4ef6a59ca9f59c900c6e0900cfb3a/builtin/common/misc_helpers.lua#L311

paramat commented 6 years ago

wrap_text was changed recently (and a 3rd argument was added) which probably caused this error. https://github.com/minetest/minetest/commit/6fa2f6b4aa42683fc85a6ce4a2a03a4b47c36974 See issue https://github.com/minetest/minetest/issues/6234 for explanation. It seems the old form was broken and weird, and it was fixed, but the nether mod depended on the old broken behaviour.

HybridDog commented 6 years ago

I amed Megaf's fix: https://github.com/HybridDog/nether-pack/commit/acdf6943563b333674bbf294b277930646890ec9 It stopped crashing now.