mt-mods / technic

Technic mod for Minetest
18 stars 22 forks source link

radiation damage crash(?) #354

Open Kimapr opened 5 months ago

Kimapr commented 5 months ago
2024-03-20 17:35:15: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'beds' in callback LuaABM::trigger(): /usr/share/minetest/builtin/common/vector.lua:162: attempt to index local 'a' (a nil value)
2024-03-20 17:35:15: ERROR[Main]: stack traceback:
2024-03-20 17:35:15: ERROR[Main]:   /usr/share/minetest/builtin/common/vector.lua:162: in function 'add'
2024-03-20 17:35:15: ERROR[Main]:   .../nonsensical_skyblock/mods/technic/technic/radiation.lua:323: in function 'dmg_object'
2024-03-20 17:35:15: ERROR[Main]:   .../nonsensical_skyblock/mods/technic/technic/radiation.lua:377: in function <.../nonsensical_skyblock/mods/technic/technic/radiation.lua:366>

version: ea14f604c9acc736f9eb1a92ab5689b598d81905

BuckarooBanzay commented 5 months ago

looks like the position returned from the entity/object was nil: https://github.com/mt-mods/technic/blob/ea14f604c9acc736f9eb1a92ab5689b598d81905/technic/radiation.lua#L323

Do you know what objects might be around there?

Athozus commented 5 months ago

looks like the position returned from the entity/object was nil:

https://github.com/mt-mods/technic/blob/ea14f604c9acc736f9eb1a92ab5689b598d81905/technic/radiation.lua#L323

Do you know what objects might be around there?

Maybe it's because bed is a node that uses two blocks of space ? So that it detected a node on the bottom of the bed, but there was no node attached (but the head of the bed). So it caused the crash.

BuckarooBanzay commented 5 months ago

Maybe it's because bed is a node that uses two blocks of space ? So that it detected a node on the bottom of the bed, but there was no node attached (but the head of the bed). So it caused the crash.

This issue has to do with entities, not nodes

a possible "fix" would be to add a nil-check to the returned position of the entity but the root-cause is not really fixed (nil returned from get_pos())

S-S-X commented 4 months ago

I think it is possible that disconnected/partial players can still be included here. If that's the case then what happens is exactly what happens here: instance is there and valid but everything returns nil as there's no data anymore.

Not necessarily cause but is a thing with certain stuff and isn't exactly a bug.