Ver código fonte

ClassCastException fix

_DS_ 15 anos atrás
pai
commit
5a020ccb10

+ 5 - 3
L2_GameServer/java/com/l2jserver/gameserver/model/L2WorldRegion.java

@@ -231,10 +231,12 @@ public final class L2WorldRegion
         				mob.getAttackByList().clear();
         				mob.getKnownList().removeAllKnownObjects();
 
-        				mob.getAI().setIntention(com.l2jserver.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE);
-
         				// stop the ai tasks
-        				((L2AttackableAI) mob.getAI()).stopAITask();
+        				if (mob.hasAI())
+        				{
+            				mob.getAI().setIntention(com.l2jserver.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE);
+            				mob.getAI().stopAITask();
+        				}
         			}
         			else if (o instanceof L2Vehicle)
         			{