minetest-mods / i3

:rocket: A next-generation inventory for Minetest 5.6+
Other
41 stars 26 forks source link

[bug]: registering aliases can cause minetest crash when something is searched in i3 #68

Closed wsor4035 closed 2 years ago

wsor4035 commented 2 years ago

Describe the bug trying to search for anything crashes minetest. see https://github.com/mt-mods/unifieddyes/issues/7

To Reproduce use a game without the dye mod add

minetest.register_alias("dye:light_red",  "dye:pink")
minetest.register_alias("dye:medium_orange", "dye:brown")

enable mod, try to search something, watch the game crash

Additional context

error stack

AsyncErr: Lua: Runtime error from mod 'i3' in callback on_playerReceiveFields(): (load):104: bad argument #2 to 'translate' (string expected, got nil)
stack traceback:
    [C]: in function 'translate'
    (load):104: in function 'search'
    (load):330: in function 'rcp_fields'
    (load):445: in function <(load):411>
    ...st\minetest-5.5.0-win64\bin\..\builtin\game\register.lua:425: in function <...st\minetest-5.5.0-win64\bin\..\builtin\game\register.lua:409>
kilbith commented 2 years ago

I can't seem to reproduce it. More information needed.

Is unifieddyes enabled?

wsor4035 commented 2 years ago

minimally reproducible example use void game + i3 + unifieddyes commit (https://github.com/mt-mods/unifieddyes/tree/ed895734f29c4fb214a82bb3bb2ac123b77fdd2e) (pre me adding a work around), then apply the latest commit and notice it doesnt crash anymore

kilbith commented 2 years ago

Indeed that happens when unifieddyes is enabled, you should have mentionned that.

https://github.com/minetest-mods/i3/commit/312da629f98dd8e84ba692e75503d043f33644e7