mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 18:41:09 +01:00
Make death check less frequent. Load passenger in minecart at shutdown.
This commit is contained in:
parent
f817fe7f72
commit
3eab946889
1 changed files with 6 additions and 3 deletions
|
@ -87,6 +87,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
|
|||
local data = minetest.deserialize(staticdata)
|
||||
if type(data) == "table" then
|
||||
self._railtype = data._railtype
|
||||
self._passenger = data._passenger
|
||||
end
|
||||
self.object:set_armor_groups({immortal=1})
|
||||
|
||||
|
@ -231,11 +232,13 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
|
|||
end
|
||||
-- Make room in the minecart after the mob dies
|
||||
elseif self._passenger then
|
||||
dead = self._passenger:check_for_death()
|
||||
if math.random(1,20) > 1 then
|
||||
local dead = self._passenger:check_for_death()
|
||||
if dead == true then
|
||||
self._passenger = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Drop minecart if it isn't on a rail anymore
|
||||
if self._last_float_check >= mcl_minecarts.check_float_time then
|
||||
|
|
Loading…
Reference in a new issue