make sure mob doesn't attack itself

This commit is contained in:
TenPlus1 2020-06-09 13:13:15 +01:00
parent d04f144b7c
commit ad116aa70e
1 changed files with 3 additions and 2 deletions

View File

@ -6,7 +6,7 @@ local use_cmi = minetest.global_exists("cmi")
mobs = {
mod = "redo",
version = "20200528",
version = "20200609",
intllib = S,
invis = minetest.global_exists("invisibility") and invisibility or {}
}
@ -2938,7 +2938,8 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir, damage)
and self.child == false
and self.attack_players == true
and hitter:get_player_name() ~= self.owner
and not mobs.invis[ name ] then
and not mobs.invis[ name ]
and self.object ~= hitter then
-- attack whoever punched mob
self.state = ""