Fixed possible NPE at Parade ai.
This commit is contained in:
@@ -223,6 +223,8 @@ public class Parade extends AbstractNpcAI
|
|||||||
for (Iterator<L2Npc> it = spawns.iterator(); it.hasNext();)
|
for (Iterator<L2Npc> it = spawns.iterator(); it.hasNext();)
|
||||||
{
|
{
|
||||||
L2Npc actor = it.next();
|
L2Npc actor = it.next();
|
||||||
|
if (actor != null)
|
||||||
|
{
|
||||||
if (actor.calculateDistance(actor.getXdestination(), actor.getYdestination(), 0, false, true) < (100 * 100))
|
if (actor.calculateDistance(actor.getXdestination(), actor.getYdestination(), 0, false, true) < (100 * 100))
|
||||||
{
|
{
|
||||||
actor.deleteMe();
|
actor.deleteMe();
|
||||||
@@ -233,6 +235,7 @@ public class Parade extends AbstractNpcAI
|
|||||||
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(actor.getXdestination(), actor.getYdestination(), actor.getZdestination(), actor.getHeading()));
|
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(actor.getXdestination(), actor.getYdestination(), actor.getZdestination(), actor.getHeading()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (spawns.size() == 0)
|
if (spawns.size() == 0)
|
||||||
{
|
{
|
||||||
deleteTask.cancel(false);
|
deleteTask.cancel(false);
|
||||||
|
Reference in New Issue
Block a user