From 65cc03bc8f04a18c45723cec5134620c788a0b5a Mon Sep 17 00:00:00 2001 From: nixnoxus Date: Sun, 3 Mar 2024 11:20:45 +0100 Subject: [PATCH] fix self attack --- mods/ENTITIES/mcl_mobs/combat.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/combat.lua b/mods/ENTITIES/mcl_mobs/combat.lua index 745a06c5c..3b28c1a37 100644 --- a/mods/ENTITIES/mcl_mobs/combat.lua +++ b/mods/ENTITIES/mcl_mobs/combat.lua @@ -360,7 +360,7 @@ function mob_class:monster_attack() player = obj.object name = obj.name or "" end - if obj and obj.type == self.type and obj.passive == false and obj.state == "attack" and obj.attack then + if obj and obj.type == self.type and obj.passive == false and obj.state == "attack" and obj.attack and self.object ~= obj.attack then table.insert(blacklist_attack, obj.attack) end end @@ -388,6 +388,7 @@ function mob_class:monster_attack() -- find specific mob to attack, failing that attack player/npc/animal if specific_attack(self.specific_attack, name) + and self.object ~= player and (type == "player" or ( type == "npc" and self.attack_npcs ) or (type == "animal" and self.attack_animals == true) or (self.extra_hostile and not self.attack_exception(player))) then