Closed evrooije closed 7 years ago
add_item crashes the game because it being outside the map limit (api.lua)
I consider this an engine a bug, it certainly should not cause a crash. Was there not some work done on this recently? I would be happy to add a sanity check on the pos though I think a check for CONTENT_IGNORE
before dropping might suffice.
I am not sure if it the responsibility of this mod to provide 'anti-cheat' functionality but I would encourage server owners to add their own little tweaks that the cheaters are not aware of.
Engine should indeed deal with this better, I have added quite a few boundary checks now already e.g. arrows from mod throwing all of a sudden appearing outside of the map limit crashing the game, the player at infinity bug, have seen entities floating in space outside the border on HOMETOWN, etc. When I have time I'll have a look at the engine repo as well to see if this has been raised before/ addressed now and if not create an issue there as well...
I was thinking about this https://github.com/minetest/minetest/pull/5889 however, this does not appear to check when adding entities outside the terrain limits.
43c9984d574f997da9fa0eea4ae14fca090abc40 should hopefully at least help prevent this.
Very rare and minor edge/ boundary issue that would only happen when someone noclips and free moves outside the map limits (e.g. a hacked client/ admin at world border) or an admin that teleports to 31000 (because too lazy to look up the exact map boundaries, like me -_-), while wearing armor. Then when the player dies and the armor is dropped (on my server that happens when not wearing a space suit at very high elevation), add_item crashes the game because it being outside the map limit (api.lua).
So a sanity check of pos around the drop code and skipping it when outside the world would make it a little more robust :) And I for one will change my code to clear inventories (including the armor one) when outside the boundaries before killing the player ;)