Don't search for target if in panic
parent
7c8137b79f
commit
fbcb952bfa
|
@ -2,7 +2,7 @@ Creatures MOB-Engine
|
||||||
====================
|
====================
|
||||||
Copyright (c) 2015 BlockMen <blockmen2015@gmail.com>
|
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.
|
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
|
if selfOrObject.stunned == true then
|
||||||
selfOrObject.stunned = false
|
selfOrObject.stunned = false
|
||||||
if selfOrObject.can_panic == true then
|
if selfOrObject.can_panic == true then
|
||||||
|
selfOrObject.target = nil
|
||||||
selfOrObject.mode = "_run"
|
selfOrObject.mode = "_run"
|
||||||
selfOrObject.modetimer = 0
|
selfOrObject.modetimer = 0
|
||||||
end
|
end
|
||||||
|
@ -436,7 +437,7 @@ creatures.on_step = function(self, dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- search a target (1-2ms)
|
-- 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
|
local timer
|
||||||
if self.hostile then
|
if self.hostile then
|
||||||
timer = def.combat.search_timer or 2
|
timer = def.combat.search_timer or 2
|
||||||
|
|
Loading…
Reference in New Issue