mods - mobs - fix stop mob attacking if mobs attack other mobs and player
* another check nil of position when there is another mob inside range of the same attack
This commit is contained in:
parent
e82e0fa9cc
commit
1b8bffe6a6
4
api.lua
4
api.lua
@ -2741,7 +2741,7 @@ function mob_class:do_states(dtime)
|
|||||||
p = {x = p1.x, y = p1.y, z = p1.z}
|
p = {x = p1.x, y = p1.y, z = p1.z}
|
||||||
end
|
end
|
||||||
|
|
||||||
self:yaw_to_pos(p)
|
if p then self:yaw_to_pos(p) end
|
||||||
|
|
||||||
-- move towards enemy if beyond mob reach
|
-- move towards enemy if beyond mob reach
|
||||||
if dist > (self.reach + (self.reach_ext or 0)) then
|
if dist > (self.reach + (self.reach_ext or 0)) then
|
||||||
@ -2785,7 +2785,7 @@ function mob_class:do_states(dtime)
|
|||||||
|
|
||||||
self:set_velocity(0)
|
self:set_velocity(0)
|
||||||
|
|
||||||
if self.timer > 1 then
|
if self.timer > 1 and p then
|
||||||
|
|
||||||
-- no custom attack or custom attack returns true to continue
|
-- no custom attack or custom attack returns true to continue
|
||||||
if not self.custom_attack
|
if not self.custom_attack
|
||||||
|
Loading…
x
Reference in New Issue
Block a user