mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-04-23 07:35:16 +02:00
Merge pull request 'Fix minecart and boat crashes, possible use of invalid player ObjectRef' (#4904) 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:
commit
7015c6bc5a
3 changed files with 8 additions and 0 deletions
mods/ENTITIES
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue