monk-afk / SquareOne

Things relating to SquareOne
monk.moe:30023
MIT License
0 stars 0 forks source link

[Bug] Placing two slabs on top of each other crashes the server guaranteed #13

Closed monk-afk closed 6 months ago

monk-afk commented 6 months ago

Slabs saw will crash server if they are placed one on top of the other

not all slabs exhibit this behavior, example, clay on clay is okay

any 8/16 slab placed on top of moreblocks:slab_brick param2 = 240 seems to crash, other slabs seem unaffected

2024-05-16 05:39:07: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'moreblocks' in callback item_OnPlace(): .../moreblocks/stairsplus/common.lua:77: attempt to perform arithmetic on a nil value
2024-05-16 05:39:07: ERROR[Main]: stack traceback:
2024-05-16 05:39:07: ERROR[Main]:   .../moreblocks/stairsplus/common.lua:77: in function <.../moreblocks/stairsplus/common.lua:42>

Add Step-by-step how to find bug


1. craft slab from default:brick
2. place slab
3. place another slab on top of moreblocks:slab_brick
___
> **What is the expected result of these steps?**

the second slab should position itself on the node above the first slab.

monk-afk commented 6 months ago

Two part issue, first was in moreblocks/stairsplus/common.lua

136:                                  >     def.is_ground_content = def.is_ground_content == true
176:    if fields.drop and not (type(fields.drop) == "table") |     if fields.drop and (type(fields.drop) ~= "table") the

second part was in unifiedbricks/init.lua

minetest.override_item("default:brick", {
  paramtype2 = "color",
  palette = "unifieddyes_palette_extended.png",
  airbrush_replacement_node = "unifiedbricks:brickblock",
  groups = {cracky = 3, ud_param2_colorable = 1},
})

comment that override, and issue is resolved.