From ad116aa70ecabcac319c045b6a2277a26744217a Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Tue, 9 Jun 2020 13:13:15 +0100 Subject: [PATCH] make sure mob doesn't attack itself --- api.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api.lua b/api.lua index 678541a..e42d44c 100644 --- a/api.lua +++ b/api.lua @@ -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 = ""