display_modpack icon indicating copy to clipboard operation
display_modpack copied to clipboard

Placing direction sign against specific nodes crashes server

Open FeXoR-o-Illuria opened this issue 4 years ago • 2 comments

Placing e.g. White direction sign (signs_road:white_right_sign) against e.g. the top part of White Truss Superstructure Simple Left End (bridger:truss_superstructure_simple_end_left_white) causes the server to crash.

Error Message: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'signs_road' in callback item_OnPlace(): /data/world//worldmods/display_modpack/signs_api/init.lua:131: attempt to compare number with nil stack traceback: /data/world//worldmods/display_modpack/signs_api/init.lua:131: in function </data/world//worldmods/display_modpack/signs_api/init.lua:91>

Another problematic nodes to place direction signs against: Spiral Staircase (homedecor:spiral_staircase) - Some of the very upper parts, probably direction dependent as well as several other rotated large superstructure nodes.

FeXoR-o-Illuria avatar Jan 09 '22 10:01 FeXoR-o-Illuria

I tested and found that for that server: display_api.is_rotation_restricted() => false minetest.registered_nodes[signs_road:white_right_sign].paramtype2 == "facedir" => true

So the only 2 lines that may cause: test[ndir] = nil (in line 131) are lines 112 and 115

In line 115 the table has numerical keys 0, 1, 2, 3, 4, 8 <- That "[8]=" looks suspicious to me and causes a holey array ;)

FeXoR-o-Illuria avatar Jan 09 '22 10:01 FeXoR-o-Illuria

@FeXoR-o-Illuria should be fixed by https://github.com/Archtec-io/display_modpack/commit/72a9d1bb7dfc9fed7cdd08b18c0cb0246c31f99e

Niklp09 avatar Jun 11 '23 13:06 Niklp09