diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 4328bd20fd..6c654c2bc6 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -117,20 +117,6 @@ local node_ok = function(pos, fallback) return minetest.registered_nodes[fallback] end - -local mob_detach_child = function(self, child) - - if self.detach_child then - if self.detach_child(self, child) then - return - end - end - if self.driver == child then - self.driver = nil - end - -end - -- get entity staticdata function mob_class:get_staticdata() diff --git a/mods/ENTITIES/mcl_mobs/mount.lua b/mods/ENTITIES/mcl_mobs/mount.lua index 95a145a4b0..0307a5fc07 100644 --- a/mods/ENTITIES/mcl_mobs/mount.lua +++ b/mods/ENTITIES/mcl_mobs/mount.lua @@ -1,4 +1,5 @@ - +local math, vector, minetest, mcl_mobs = math, vector, minetest, mcl_mobs +local mob_class = mcl_mobs.mob_class -- lib_mount by Blert2112 (edited by TenPlus1) local enable_crash = false @@ -446,3 +447,14 @@ function mcl_mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_an mcl_mobs:set_animation(entity, moving_anim) end end + +function mob_class:on_detach_child(child) + if self.detach_child then + if self.detach_child(self, child) then + return + end + end + if self.driver == child then + self.driver = nil + end +end