Merge pull request 'Fix minecart and boat crashes, possible use of invalid player ObjectRef' () from fix-missing-uuid into master

Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4904
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
This commit is contained in:
the-real-herowl 2025-03-06 15:19:28 +01:00
commit 7015c6bc5a
3 changed files with 8 additions and 0 deletions
mods/ENTITIES
mcl_boats
mcl_burning
mcl_minecarts

View file

@ -175,6 +175,11 @@ function boat.on_activate(self, staticdata, dtime_s)
self._last_v = self._v
self._itemstring = data.itemstring
-- Fix data corruption
if not data.textures then
data.textures = self.textures
end
-- Update the texutes for existing old boat entity instances.
-- Maybe remove this in the future.
if #data.textures ~= 2 then

View file

@ -51,6 +51,8 @@ local find_nodes_in_area = minetest.find_nodes_in_area
function mcl_burning.get_touching_nodes(obj, nodenames, storage)
local pos = obj:get_pos()
if not pos then return {} end
local minp, maxp = mcl_burning.get_collisionbox(obj, true, storage)
local nodes = find_nodes_in_area(vector.add(pos, minp), vector.add(pos, maxp), nodenames)
return nodes

View file

@ -24,6 +24,7 @@ local function get_cart_data(uuid)
if data.distance == -0/0 then data.distance = 0 end
data.dir = vector.new(data.dir)
data.connected_at = vector.new(data.connected_at)
data.uuid = uuid
end
cart_data[uuid] = data