pyrollo / display_modpack

Display modpack for Minetest, provides mods with dynamic display and font display : clocks, signs, and more.
GNU Lesser General Public License v3.0
25 stars 27 forks source link

Placing direction sign against specific nodes crashes server #48

Open FeXoR-o-Illuria opened 2 years ago

FeXoR-o-Illuria commented 2 years ago

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 commented 2 years ago

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 ;)

Niklp09 commented 1 year ago

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