From 42dbc62f6888a8b11823ec7223608fc5ff0a20fa Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Thu, 14 Sep 2017 22:47:17 +0000 Subject: [PATCH] Fixed Fear issues. --- .../com/l2jmobius/gameserver/ai/L2AttackableAI.java | 11 +++++++---- .../com/l2jmobius/gameserver/ai/L2CharacterAI.java | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 80644f2f73..d03b48e301 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -88,10 +88,13 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable @Override public void run() { - final int fearTimeLeft = _ai.getFearTime() - FEAR_TICKS; - _ai.setFearTime(fearTimeLeft); - _ai.onEvtAfraid(_effector, _start); - _start = false; + if (_effector != null) + { + final int fearTimeLeft = _ai.getFearTime() - FEAR_TICKS; + _ai.setFearTime(fearTimeLeft); + _ai.onEvtAfraid(_effector, _start); + _start = false; + } } } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java index 7e23606285..e1dc800a20 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2CharacterAI.java @@ -911,7 +911,7 @@ public class L2CharacterAI extends AbstractAI } // If pathfinding enabled the creature will go to the destination or it will go to the nearest obstacle. - setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, Config.PATHFINDING ? GeoEngine.getInstance().canMoveToTarget(_actor.getX(), _actor.getY(), _actor.getZ(), posX, posY, posZ, _actor.getInstanceId()) : new Location(posX, posY, posZ)); + setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, Config.PATHFINDING ? GeoEngine.getInstance().canMoveToTargetLoc(_actor.getX(), _actor.getY(), _actor.getZ(), posX, posY, posZ, _actor.getInstanceId()) : new Location(posX, posY, posZ)); } protected boolean maybeMoveToPosition(ILocational worldPosition, int offset)