Don't search for target if in panic

master
BlockMen 2016-02-03 13:28:52 +01:00
parent 7c8137b79f
commit fbcb952bfa
2 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,7 @@ Creatures MOB-Engine
====================
Copyright (c) 2015 BlockMen <blockmen2015@gmail.com>
Version: 2.0.1
Version: 2.0.2
This mod provides an engine, that handles the base function for MOB in Minetest.

View File

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