Don't search for target if in panic
This commit is contained in:
parent
7c8137b79f
commit
fbcb952bfa
@ -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.
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user