From 5e6653ff651a65e6bfc4057cb5de39f09e9b9cca Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Sun, 25 Apr 2021 04:19:02 -0400 Subject: [PATCH] Implement mob cramming --- mods/ENTITIES/mcl_mobs/api/mob_functions/collision.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/collision.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/collision.lua index 60f0aeeb4..44f43f20f 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/collision.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/collision.lua @@ -39,13 +39,15 @@ mobs.collision = function(self) end for _,object in ipairs(minetest_get_objects_inside_radius(pos, radius*1.25)) do - if object and object ~= self.object and (object:is_player() or (object:get_luaentity() and object:get_luaentity()._cmi_is_mob == true)) and + if object and object ~= self.object and (object:is_player() or (object:get_luaentity() and object:get_luaentity()._cmi_is_mob == true and object:get_luaentity().health > 0)) and --don't collide with rider, rider don't collide with thing (not object:get_attach() or (object:get_attach() and object:get_attach() ~= self.object)) and (not self.object:get_attach() or (self.object:get_attach() and self.object:get_attach() ~= object)) then --stop infinite loop collision_count = collision_count + 1 - if collision_count > 100 then + --mob cramming + if collision_count > 30 then + self.health = -20 break end