World object null checks.

This commit is contained in:
MobiusDevelopment 2020-09-04 18:50:00 +00:00
parent f8411b953e
commit 0ec7e382dd
38 changed files with 321 additions and 78 deletions

View File

@ -413,7 +413,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -482,7 +482,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -542,7 +542,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
if ((wo == null) || (wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -413,7 +413,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -482,7 +482,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -542,7 +542,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
if ((wo == null) || (wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -413,7 +413,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -482,7 +482,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -542,7 +542,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
if ((wo == null) || (wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -413,7 +413,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -482,7 +482,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -542,7 +542,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
if ((wo == null) || (wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -413,7 +413,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -482,7 +482,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -542,7 +542,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
if ((wo == null) || (wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -413,7 +413,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -482,7 +482,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -542,7 +542,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
if ((wo == null) || (wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -413,7 +413,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -482,7 +482,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -542,7 +542,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
if ((wo == null) || (wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -413,7 +413,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -482,7 +482,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -542,7 +542,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
if ((wo == null) || (wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -300,6 +300,10 @@ public class World
for (int i = 0; i < visibleObjects.size(); i++)
{
final WorldObject wo = visibleObjects.get(i);
if (wo == null)
{
continue;
}
// Add the object in WorldObjectHashSet(WorldObject) _knownObjects of the visible Creature according to conditions :
// - Creature is visible
@ -332,6 +336,10 @@ public class World
for (int i = 0; i < visibleObjects.size(); i++)
{
final WorldObject wo = visibleObjects.get(i);
if (wo == null)
{
continue;
}
// Add the object in WorldObjectHashSet(WorldObject) _knownObjects of the visible Creature according to conditions :
// - Creature is visible
@ -413,11 +421,15 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == null)
{
continue;
}
// Remove the WorldObject from the WorldObjectHashSet(WorldObject) _knownObjects of the surrounding WorldRegion Creatures
// If object is a PlayerInstance, remove the WorldObject from the WorldObjectHashSet(PlayerInstance) _knownPlayer of the surrounding WorldRegion Creatures
// If object is targeted by one of the surrounding WorldRegion Creatures, cancel ATTACK and cast
if ((wo != null) && (wo.getKnownList() != null))
if (wo.getKnownList() != null)
{
wo.getKnownList().removeKnownObject(object);
}

View File

@ -125,6 +125,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo instanceof Attackable)
{
final Attackable mob = (Attackable) wo;
@ -173,6 +178,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo instanceof Attackable)
{
// Start HP/MP/CP Regeneration task
@ -204,7 +214,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}
@ -382,10 +393,15 @@ public class WorldRegion
LOGGER.info("Deleting all visible NPCs in Region: " + getName());
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject obj = _visibleObjects.get(i);
if (obj instanceof NpcInstance)
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
final NpcInstance target = (NpcInstance) obj;
continue;
}
if (wo instanceof NpcInstance)
{
final NpcInstance target = (NpcInstance) wo;
target.deleteMe();
final Spawn spawn = target.getSpawn();
if (spawn != null)

View File

@ -300,6 +300,10 @@ public class World
for (int i = 0; i < visibleObjects.size(); i++)
{
final WorldObject wo = visibleObjects.get(i);
if (wo == null)
{
continue;
}
// Add the object in WorldObjectHashSet(WorldObject) _knownObjects of the visible Creature according to conditions :
// - Creature is visible
@ -332,6 +336,10 @@ public class World
for (int i = 0; i < visibleObjects.size(); i++)
{
final WorldObject wo = visibleObjects.get(i);
if (wo == null)
{
continue;
}
// Add the object in WorldObjectHashSet(WorldObject) _knownObjects of the visible Creature according to conditions :
// - Creature is visible
@ -413,11 +421,15 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == null)
{
continue;
}
// Remove the WorldObject from the WorldObjectHashSet(WorldObject) _knownObjects of the surrounding WorldRegion Creatures
// If object is a PlayerInstance, remove the WorldObject from the WorldObjectHashSet(PlayerInstance) _knownPlayer of the surrounding WorldRegion Creatures
// If object is targeted by one of the surrounding WorldRegion Creatures, cancel ATTACK and cast
if ((wo != null) && (wo.getKnownList() != null))
if (wo.getKnownList() != null)
{
wo.getKnownList().removeKnownObject(object);
}

View File

@ -125,6 +125,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo instanceof Attackable)
{
final Attackable mob = (Attackable) wo;
@ -173,6 +178,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo instanceof Attackable)
{
// Start HP/MP/CP Regeneration task
@ -204,7 +214,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}
@ -382,10 +393,15 @@ public class WorldRegion
LOGGER.info("Deleting all visible NPCs in Region: " + getName());
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject obj = _visibleObjects.get(i);
if (obj instanceof NpcInstance)
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
final NpcInstance target = (NpcInstance) obj;
continue;
}
if (wo instanceof NpcInstance)
{
final NpcInstance target = (NpcInstance) wo;
target.deleteMe();
final Spawn spawn = target.getSpawn();
if (spawn != null)

View File

@ -409,7 +409,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -478,7 +478,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -538,7 +538,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceId() != object.getInstanceId()))
if ((wo == null) || (wo == object) || (wo.getInstanceId() != object.getInstanceId()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -409,7 +409,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -478,7 +478,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -538,7 +538,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceId() != object.getInstanceId()))
if ((wo == null) || (wo == object) || (wo.getInstanceId() != object.getInstanceId()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -413,7 +413,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -482,7 +482,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -542,7 +542,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
if ((wo == null) || (wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -413,7 +413,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -482,7 +482,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -542,7 +542,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
if ((wo == null) || (wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -413,7 +413,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -482,7 +482,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -542,7 +542,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
if ((wo == null) || (wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -413,7 +413,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -482,7 +482,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -542,7 +542,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
if ((wo == null) || (wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -413,7 +413,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -482,7 +482,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -542,7 +542,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
if ((wo == null) || (wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -413,7 +413,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -482,7 +482,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -542,7 +542,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
if ((wo == null) || (wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}

View File

@ -413,7 +413,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -482,7 +482,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if (wo == object)
if ((wo == null) || (wo == object))
{
continue;
}
@ -542,7 +542,7 @@ public class World
for (int j = 0; j < visibleObjects.size(); j++)
{
final WorldObject wo = visibleObjects.get(j);
if ((wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
if ((wo == null) || (wo == object) || (wo.getInstanceWorld() != object.getInstanceWorld()))
{
continue;
}

View File

@ -55,6 +55,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
final Attackable mob = (Attackable) wo;
@ -91,6 +96,11 @@ public class WorldRegion
for (int i = 0; i < _visibleObjects.size(); i++)
{
final WorldObject wo = _visibleObjects.get(i);
if (wo == null)
{
continue;
}
if (wo.isAttackable())
{
// Start HP/MP/CP regeneration task.
@ -120,7 +130,8 @@ public class WorldRegion
final List<WorldObject> regionObjects = worldRegion.getVisibleObjects();
for (int j = 0; j < regionObjects.size(); j++)
{
if (regionObjects.get(j).isPlayable())
final WorldObject wo = regionObjects.get(j);
if ((wo != null) && wo.isPlayable())
{
return false;
}