From 0ec7e382dd304a8e5a55079299efa7fbf7802c3e Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Fri, 4 Sep 2020 18:50:00 +0000 Subject: [PATCH] World object null checks. --- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 14 ++++++++++- .../gameserver/model/WorldRegion.java | 24 +++++++++++++++---- .../org/l2jmobius/gameserver/model/World.java | 14 ++++++++++- .../gameserver/model/WorldRegion.java | 24 +++++++++++++++---- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- .../org/l2jmobius/gameserver/model/World.java | 6 ++--- .../gameserver/model/WorldRegion.java | 13 +++++++++- 38 files changed, 321 insertions(+), 78 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/World.java index 2944adf36a..907fee9938 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/World.java index 2944adf36a..907fee9938 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/World.java index 2944adf36a..907fee9938 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/World.java index 2944adf36a..907fee9938 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/World.java index 2944adf36a..907fee9938 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/World.java index 2944adf36a..907fee9938 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/World.java index 2944adf36a..907fee9938 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/World.java index 2944adf36a..907fee9938 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/World.java index 0910a92c11..3469e7aa9b 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/World.java @@ -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); } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/WorldRegion.java index 0acd65b874..90c1eeb824 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/World.java index 0910a92c11..3469e7aa9b 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/World.java @@ -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); } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/WorldRegion.java index 0acd65b874..90c1eeb824 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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) diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/World.java index 652a9c0030..e6ba8b35e1 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/World.java index 652a9c0030..e6ba8b35e1 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/World.java index 2944adf36a..907fee9938 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/World.java index 2944adf36a..907fee9938 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/World.java index 2944adf36a..907fee9938 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/World.java index 2944adf36a..907fee9938 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/World.java index 2944adf36a..907fee9938 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/World.java index 2944adf36a..907fee9938 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; } diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/World.java index 2944adf36a..907fee9938 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/World.java @@ -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; } diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/WorldRegion.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/WorldRegion.java index 95e983442d..a27867b65f 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/WorldRegion.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/WorldRegion.java @@ -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 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; }