Fix crash when creeper explodes in minecart
parent
5507e99582
commit
be8d9122ee
|
@ -5,7 +5,12 @@ function mcl_burning.get_storage(obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
function mcl_burning.is_burning(obj)
|
function mcl_burning.is_burning(obj)
|
||||||
|
local storage = mcl_burning.get_storage(obj)
|
||||||
|
if storage then
|
||||||
return mcl_burning.get_storage(obj).burn_time
|
return mcl_burning.get_storage(obj).burn_time
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function mcl_burning.is_affected_by_rain(obj)
|
function mcl_burning.is_affected_by_rain(obj)
|
||||||
|
|
|
@ -370,15 +370,12 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Make room in the minecart after the mob dies
|
|
||||||
elseif self._passenger then
|
elseif self._passenger then
|
||||||
if math.random(1,20) == 1 then
|
local passenger_pos = self._passenger.object:get_pos()
|
||||||
local dead = self._passenger:check_for_death()
|
if not passenger_pos then
|
||||||
if dead == true then
|
|
||||||
self._passenger = nil
|
self._passenger = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
-- Drop minecart if it isn't on a rail anymore
|
-- Drop minecart if it isn't on a rail anymore
|
||||||
if self._last_float_check >= mcl_minecarts.check_float_time then
|
if self._last_float_check >= mcl_minecarts.check_float_time then
|
||||||
|
|
Loading…
Reference in New Issue