forked from VoxeLibre/VoxeLibre
fix self attack
This commit is contained in:
parent
f54f838d26
commit
65cc03bc8f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue