mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 04:21:07 +01:00
Fix crash when riding player leaves
This commit is contained in:
parent
4ece91fde4
commit
401382106f
1 changed files with 9 additions and 0 deletions
|
@ -2791,6 +2791,13 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
|
|||
end
|
||||
end
|
||||
|
||||
local mob_detach_child = function(self, child)
|
||||
|
||||
if self.driver == child then
|
||||
self.driver = nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- get entity staticdata
|
||||
local mob_staticdata = function(self)
|
||||
|
@ -3362,6 +3369,8 @@ minetest.register_entity(name, {
|
|||
|
||||
on_grown = def.on_grown,
|
||||
|
||||
on_detach_child = mob_detach_child,
|
||||
|
||||
on_activate = function(self, staticdata, dtime)
|
||||
return mob_activate(self, staticdata, def, dtime)
|
||||
end,
|
||||
|
|
Loading…
Reference in a new issue