fix self attack

This commit is contained in:
nixnoxus 2024-03-03 11:20:45 +01:00
parent f54f838d26
commit 65cc03bc8f
1 changed files with 2 additions and 1 deletions

View File

@ -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