minetest-mods / mesecons

Mod for Minetest that adds digital circuitry [=Minecraft redstone]
https://mesecons.net
Other
211 stars 120 forks source link

Regression caused by b46c589 #684

Open appgurueu opened 2 days ago

appgurueu commented 2 days ago

See https://forum.minetest.net/viewtopic.php?p=439964#p439964:

After downloading the latest update to this mod on 10/16/24, the mod is crashing the game with the following error:

ModError: Runtime error from mod 'mesecons_doors' in callback on_mods_loaded(): ...64\minetest\bin\..\mods\mesecons\mesecons_doors\init.lua:135: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
...64\minetest\bin\..\mods\mesecons\mesecons_doors\init.lua:135: in function <...64\minetest\bin\..\mods\mesecons\mesecons_doors\init.lua:134>
...t 5.4.1 -win64\minetest\bin\..\builtin\game\register.lua:431: in function <...t 5.4.1 -win64\minetest\bin\..\builtin\game\register.lua:417>

The line in question: https://github.com/minetest-mods/mesecons/blob/b46c589a38c98b4fe84716922dbabb21841bca67/mesecons_doors/init.lua#L135

Just a simple or {} should fix it. Same should be done right below. Though I do wonder what would cause doors.registered_doors to be nil despite mesecons_doors depending on doors. Maybe there is an API-incompatible mod called doors out there?

Niklp09 commented 2 days ago

https://content.minetest.net/modnames/doors/ Tested TenPlus1's doors_redo. Their mod works fine and provides the required table.

sfan5 commented 2 days ago

Before simply adding a nil check we should find out the cause.

Niklp09 commented 2 days ago

Before simply adding a nil check we should find out the cause.

That's why I asked the initial reporter in the forums for more information.