From fbcb952bfa92344780d9e67b054d9ba854d458fe Mon Sep 17 00:00:00 2001 From: BlockMen Date: Wed, 3 Feb 2016 13:28:52 +0100 Subject: [PATCH] Don't search for target if in panic --- creatures/README.txt | 2 +- creatures/functions.lua | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/creatures/README.txt b/creatures/README.txt index 008708c..4dcf72b 100644 --- a/creatures/README.txt +++ b/creatures/README.txt @@ -2,7 +2,7 @@ Creatures MOB-Engine ==================== Copyright (c) 2015 BlockMen -Version: 2.0.1 +Version: 2.0.2 This mod provides an engine, that handles the base function for MOB in Minetest. diff --git a/creatures/functions.lua b/creatures/functions.lua index 56b5390..170eb6f 100644 --- a/creatures/functions.lua +++ b/creatures/functions.lua @@ -39,6 +39,7 @@ local function knockback(selfOrObject, dir, old_dir, strengh) if selfOrObject.stunned == true then selfOrObject.stunned = false if selfOrObject.can_panic == true then + selfOrObject.target = nil selfOrObject.mode = "_run" selfOrObject.modetimer = 0 end @@ -436,7 +437,7 @@ creatures.on_step = function(self, dtime) end -- search a target (1-2ms) - if not self.target and ((self.hostile and def.combat.search_enemy) or modes["follow"]) then + if not self.target and ((self.hostile and def.combat.search_enemy) or modes["follow"]) and current_mode ~= "_run" then local timer if self.hostile then timer = def.combat.search_timer or 2