diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/L2ZoneRespawn.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/L2ZoneRespawn.java index e99617308c..95a1aba234 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/L2ZoneRespawn.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/L2ZoneRespawn.java @@ -152,7 +152,7 @@ public abstract class L2ZoneRespawn extends L2ZoneType return getSpawnLoc(); } - public final Location getBanishSpawnLoc() + public Location getBanishSpawnLoc() { if (_banishSpawnLocs != null) { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java index 71c57b6053..04eca534a0 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java @@ -46,7 +46,7 @@ public abstract class L2ZoneType extends ListenersContainer private final int _id; protected L2ZoneForm _zone; - protected Map _characterList; + protected Map _characterList = new ConcurrentHashMap<>(); /** Parameters to affect specific characters */ private boolean _checkAffected = false; @@ -66,7 +66,6 @@ public abstract class L2ZoneType extends ListenersContainer protected L2ZoneType(int id) { _id = id; - _characterList = new ConcurrentHashMap<>(); _minLvl = 0; _maxLvl = 0xFF; @@ -359,7 +358,7 @@ public abstract class L2ZoneType extends ListenersContainer */ public boolean isInsideZone(int x, int y) { - return _zone.isInsideZone(x, y, _zone.getHighZ()); + return isInsideZone(x, y, _zone.getHighZ()); } /** @@ -369,7 +368,7 @@ public abstract class L2ZoneType extends ListenersContainer */ public boolean isInsideZone(ILocational loc) { - return _zone.isInsideZone(loc.getX(), loc.getY(), loc.getZ()); + return isInsideZone(loc.getX(), loc.getY(), loc.getZ()); } /** @@ -396,24 +395,19 @@ public abstract class L2ZoneType extends ListenersContainer public void revalidateInZone(L2Character character) { - // If the character can't be affected by this zone return - if (_checkAffected && !isAffected(character)) - { - return; - } - // If the object is inside the zone... if (isInsideZone(character)) { - // Was the character not yet inside this zone? - if (!_characterList.containsKey(character.getObjectId())) + // If the character can't be affected by this zone return + if (_checkAffected && !isAffected(character)) + { + return; + } + + if (_characterList.putIfAbsent(character.getObjectId(), character) == null) { // Notify to scripts. EventDispatcher.getInstance().notifyEventAsync(new OnCreatureZoneEnter(character, this), this); - - // Register player. - _characterList.put(character.getObjectId(), character); - // Notify Zone implementation. onEnter(character); } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/TaskZoneSettings.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/TaskZoneSettings.java index 56c1043c84..9adacac2d3 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/TaskZoneSettings.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/TaskZoneSettings.java @@ -47,11 +47,10 @@ public class TaskZoneSettings extends AbstractZoneSettings @Override public void clear() { - if (_task == null) + if (_task != null) { - return; + _task.cancel(true); + _task = null; } - _task.cancel(true); - _task = null; } } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2ArenaZone.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2ArenaZone.java index a36009b307..228b05eec4 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2ArenaZone.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/type/L2ArenaZone.java @@ -38,7 +38,10 @@ public class L2ArenaZone extends L2ZoneType { if (character instanceof L2PcInstance) { - character.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE); + if (!character.isInsideZone(ZoneId.PVP)) + { + character.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE); + } } character.setInsideZone(ZoneId.PVP, true); @@ -47,9 +50,12 @@ public class L2ArenaZone extends L2ZoneType @Override protected void onExit(L2Character character) { - if ((character instanceof L2PcInstance) && !character.isInsideZone(ZoneId.PVP)) + if (character instanceof L2PcInstance) { - character.sendPacket(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE); + if (!character.isInsideZone(ZoneId.PVP)) + { + character.sendPacket(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE); + } } character.setInsideZone(ZoneId.PVP, false);