diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 23ae510e98..0850de02ed 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -212,7 +212,6 @@ public final class L2WorldRegion
/**
* Add the L2Object in the L2ObjectHashSet(L2Object) _visibleObjects containing L2Object visible in this L2WorldRegion
* If L2Object is a L2PcInstance, Add the L2PcInstance in the L2ObjectHashSet(L2PcInstance) _allPlayable containing L2PcInstance of all player in game in this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this
* @param object
*/
public void addVisibleObject(L2Object object)
@@ -222,7 +221,6 @@ public final class L2WorldRegion
return;
}
- assert object.getWorldRegion() == this;
if (_visibleObjects == null)
{
synchronized (object)
@@ -247,7 +245,6 @@ public final class L2WorldRegion
/**
* Remove the L2Object from the L2ObjectHashSet(L2Object) _visibleObjects in this L2WorldRegion. If L2Object is a L2PcInstance, remove it from the L2ObjectHashSet(L2PcInstance) _allPlayable of this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this || object.getCurrentWorldRegion() == null
* @param object
*/
public void removeVisibleObject(L2Object object)
@@ -257,7 +254,6 @@ public final class L2WorldRegion
return;
}
- assert (object.getWorldRegion() == this) || (object.getWorldRegion() == null);
if (_visibleObjects == null)
{
return;
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
index c631dcb29a..87a89d8fc1 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
@@ -1015,8 +1015,10 @@ public abstract class Inventory extends ItemContainer
*/
public synchronized void addPaperdollListener(PaperdollListener listener)
{
- assert !_paperdollListeners.contains(listener);
- _paperdollListeners.add(listener);
+ if (!_paperdollListeners.contains(listener))
+ {
+ _paperdollListeners.add(listener);
+ }
}
/**
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
index fc871fca27..3d8a2dea49 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
@@ -265,11 +265,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T REMOVE the object from _allObjects of L2World
*
- * Assert :
- *
- *
this.isItem().
- * _worldRegion != null (L2Object is visible at the beginning)
- *
* Example of use :
*
* Do Pickup Item : PCInstance and Pet
@@ -278,8 +273,6 @@ public final class L2ItemInstance extends L2Object
*/
public final void pickupMe(L2Character character)
{
- assert getWorldRegion() != null;
-
final L2WorldRegion oldregion = getWorldRegion();
// Create a server->client GetItem packet to pick up the L2ItemInstance
@@ -584,7 +577,6 @@ public final class L2ItemInstance extends L2Object
*/
public int getLocationSlot()
{
- assert (_loc == ItemLocation.PAPERDOLL) || (_loc == ItemLocation.PET_EQUIP) || (_loc == ItemLocation.INVENTORY) || (_loc == ItemLocation.MAIL) || (_loc == ItemLocation.FREIGHT);
return _locData;
}
@@ -1512,10 +1504,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T ADD the object to _allObjects of L2World
*
- * Assert :
- *
- * _worldRegion == null (L2Object is invisible at the beginning)
- *
* Example of use :
*
* Drop item
@@ -1539,8 +1527,6 @@ public final class L2ItemInstance extends L2Object
@Override
public final void run()
{
- assert _itеm.getWorldRegion() == null;
-
if (_dropper != null)
{
final Instance instance = _dropper.getInstanceWorld();
@@ -1590,14 +1576,7 @@ public final class L2ItemInstance extends L2Object
*/
private void updateInDb()
{
- assert _existsInDb;
-
- if (_wear)
- {
- return;
- }
-
- if (_storedInDb)
+ if (!_existsInDb || _wear || _storedInDb)
{
return;
}
@@ -1630,9 +1609,7 @@ public final class L2ItemInstance extends L2Object
*/
private void insertIntoDb()
{
- assert !_existsInDb && (getObjectId() != 0);
-
- if (_wear)
+ if (_existsInDb || (getObjectId() == 0) || _wear)
{
return;
}
@@ -1676,9 +1653,7 @@ public final class L2ItemInstance extends L2Object
*/
private void removeFromDb()
{
- assert _existsInDb;
-
- if (_wear)
+ if (!_existsInDb || _wear)
{
return;
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 23ae510e98..0850de02ed 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -212,7 +212,6 @@ public final class L2WorldRegion
/**
* Add the L2Object in the L2ObjectHashSet(L2Object) _visibleObjects containing L2Object visible in this L2WorldRegion
* If L2Object is a L2PcInstance, Add the L2PcInstance in the L2ObjectHashSet(L2PcInstance) _allPlayable containing L2PcInstance of all player in game in this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this
* @param object
*/
public void addVisibleObject(L2Object object)
@@ -222,7 +221,6 @@ public final class L2WorldRegion
return;
}
- assert object.getWorldRegion() == this;
if (_visibleObjects == null)
{
synchronized (object)
@@ -247,7 +245,6 @@ public final class L2WorldRegion
/**
* Remove the L2Object from the L2ObjectHashSet(L2Object) _visibleObjects in this L2WorldRegion. If L2Object is a L2PcInstance, remove it from the L2ObjectHashSet(L2PcInstance) _allPlayable of this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this || object.getCurrentWorldRegion() == null
* @param object
*/
public void removeVisibleObject(L2Object object)
@@ -257,7 +254,6 @@ public final class L2WorldRegion
return;
}
- assert (object.getWorldRegion() == this) || (object.getWorldRegion() == null);
if (_visibleObjects == null)
{
return;
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
index 61b8cec043..102306be1b 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
@@ -1045,8 +1045,10 @@ public abstract class Inventory extends ItemContainer
*/
public synchronized void addPaperdollListener(PaperdollListener listener)
{
- assert !_paperdollListeners.contains(listener);
- _paperdollListeners.add(listener);
+ if (!_paperdollListeners.contains(listener))
+ {
+ _paperdollListeners.add(listener);
+ }
}
/**
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
index 4e4aa1b790..4b3cd1f785 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
@@ -272,11 +272,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T REMOVE the object from _allObjects of L2World
*
- * Assert :
- *
- * this.isItem().
- * _worldRegion != null (L2Object is visible at the beginning)
- *
* Example of use :
*
* Do Pickup Item : PCInstance and Pet
@@ -285,8 +280,6 @@ public final class L2ItemInstance extends L2Object
*/
public final void pickupMe(L2Character character)
{
- assert getWorldRegion() != null;
-
final L2WorldRegion oldregion = getWorldRegion();
// Create a server->client GetItem packet to pick up the L2ItemInstance
@@ -591,7 +584,6 @@ public final class L2ItemInstance extends L2Object
*/
public int getLocationSlot()
{
- assert (_loc == ItemLocation.PAPERDOLL) || (_loc == ItemLocation.PET_EQUIP) || (_loc == ItemLocation.INVENTORY) || (_loc == ItemLocation.MAIL) || (_loc == ItemLocation.FREIGHT);
return _locData;
}
@@ -1519,10 +1511,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T ADD the object to _allObjects of L2World
*
- * Assert :
- *
- * _worldRegion == null (L2Object is invisible at the beginning)
- *
* Example of use :
*
* Drop item
@@ -1546,8 +1534,6 @@ public final class L2ItemInstance extends L2Object
@Override
public final void run()
{
- assert _itеm.getWorldRegion() == null;
-
if (_dropper != null)
{
final Instance instance = _dropper.getInstanceWorld();
@@ -1597,14 +1583,7 @@ public final class L2ItemInstance extends L2Object
*/
private void updateInDb()
{
- assert _existsInDb;
-
- if (_wear)
- {
- return;
- }
-
- if (_storedInDb)
+ if (!_existsInDb || _wear || _storedInDb)
{
return;
}
@@ -1637,9 +1616,7 @@ public final class L2ItemInstance extends L2Object
*/
private void insertIntoDb()
{
- assert !_existsInDb && (getObjectId() != 0);
-
- if (_wear)
+ if (_existsInDb || (getObjectId() == 0) || _wear)
{
return;
}
@@ -1687,9 +1664,7 @@ public final class L2ItemInstance extends L2Object
*/
private void removeFromDb()
{
- assert _existsInDb;
-
- if (_wear)
+ if (!_existsInDb || _wear)
{
return;
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 23ae510e98..0850de02ed 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -212,7 +212,6 @@ public final class L2WorldRegion
/**
* Add the L2Object in the L2ObjectHashSet(L2Object) _visibleObjects containing L2Object visible in this L2WorldRegion
* If L2Object is a L2PcInstance, Add the L2PcInstance in the L2ObjectHashSet(L2PcInstance) _allPlayable containing L2PcInstance of all player in game in this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this
* @param object
*/
public void addVisibleObject(L2Object object)
@@ -222,7 +221,6 @@ public final class L2WorldRegion
return;
}
- assert object.getWorldRegion() == this;
if (_visibleObjects == null)
{
synchronized (object)
@@ -247,7 +245,6 @@ public final class L2WorldRegion
/**
* Remove the L2Object from the L2ObjectHashSet(L2Object) _visibleObjects in this L2WorldRegion. If L2Object is a L2PcInstance, remove it from the L2ObjectHashSet(L2PcInstance) _allPlayable of this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this || object.getCurrentWorldRegion() == null
* @param object
*/
public void removeVisibleObject(L2Object object)
@@ -257,7 +254,6 @@ public final class L2WorldRegion
return;
}
- assert (object.getWorldRegion() == this) || (object.getWorldRegion() == null);
if (_visibleObjects == null)
{
return;
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
index 61b8cec043..102306be1b 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
@@ -1045,8 +1045,10 @@ public abstract class Inventory extends ItemContainer
*/
public synchronized void addPaperdollListener(PaperdollListener listener)
{
- assert !_paperdollListeners.contains(listener);
- _paperdollListeners.add(listener);
+ if (!_paperdollListeners.contains(listener))
+ {
+ _paperdollListeners.add(listener);
+ }
}
/**
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
index 4e4aa1b790..4b3cd1f785 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
@@ -272,11 +272,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T REMOVE the object from _allObjects of L2World
*
- * Assert :
- *
- * this.isItem().
- * _worldRegion != null (L2Object is visible at the beginning)
- *
* Example of use :
*
* Do Pickup Item : PCInstance and Pet
@@ -285,8 +280,6 @@ public final class L2ItemInstance extends L2Object
*/
public final void pickupMe(L2Character character)
{
- assert getWorldRegion() != null;
-
final L2WorldRegion oldregion = getWorldRegion();
// Create a server->client GetItem packet to pick up the L2ItemInstance
@@ -591,7 +584,6 @@ public final class L2ItemInstance extends L2Object
*/
public int getLocationSlot()
{
- assert (_loc == ItemLocation.PAPERDOLL) || (_loc == ItemLocation.PET_EQUIP) || (_loc == ItemLocation.INVENTORY) || (_loc == ItemLocation.MAIL) || (_loc == ItemLocation.FREIGHT);
return _locData;
}
@@ -1519,10 +1511,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T ADD the object to _allObjects of L2World
*
- * Assert :
- *
- * _worldRegion == null (L2Object is invisible at the beginning)
- *
* Example of use :
*
* Drop item
@@ -1546,8 +1534,6 @@ public final class L2ItemInstance extends L2Object
@Override
public final void run()
{
- assert _itеm.getWorldRegion() == null;
-
if (_dropper != null)
{
final Instance instance = _dropper.getInstanceWorld();
@@ -1597,14 +1583,7 @@ public final class L2ItemInstance extends L2Object
*/
private void updateInDb()
{
- assert _existsInDb;
-
- if (_wear)
- {
- return;
- }
-
- if (_storedInDb)
+ if (!_existsInDb || _wear || _storedInDb)
{
return;
}
@@ -1637,9 +1616,7 @@ public final class L2ItemInstance extends L2Object
*/
private void insertIntoDb()
{
- assert !_existsInDb && (getObjectId() != 0);
-
- if (_wear)
+ if (_existsInDb || (getObjectId() == 0) || _wear)
{
return;
}
@@ -1687,9 +1664,7 @@ public final class L2ItemInstance extends L2Object
*/
private void removeFromDb()
{
- assert _existsInDb;
-
- if (_wear)
+ if (!_existsInDb || _wear)
{
return;
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 23ae510e98..0850de02ed 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -212,7 +212,6 @@ public final class L2WorldRegion
/**
* Add the L2Object in the L2ObjectHashSet(L2Object) _visibleObjects containing L2Object visible in this L2WorldRegion
* If L2Object is a L2PcInstance, Add the L2PcInstance in the L2ObjectHashSet(L2PcInstance) _allPlayable containing L2PcInstance of all player in game in this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this
* @param object
*/
public void addVisibleObject(L2Object object)
@@ -222,7 +221,6 @@ public final class L2WorldRegion
return;
}
- assert object.getWorldRegion() == this;
if (_visibleObjects == null)
{
synchronized (object)
@@ -247,7 +245,6 @@ public final class L2WorldRegion
/**
* Remove the L2Object from the L2ObjectHashSet(L2Object) _visibleObjects in this L2WorldRegion. If L2Object is a L2PcInstance, remove it from the L2ObjectHashSet(L2PcInstance) _allPlayable of this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this || object.getCurrentWorldRegion() == null
* @param object
*/
public void removeVisibleObject(L2Object object)
@@ -257,7 +254,6 @@ public final class L2WorldRegion
return;
}
- assert (object.getWorldRegion() == this) || (object.getWorldRegion() == null);
if (_visibleObjects == null)
{
return;
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
index 57e2c1738c..6d4f0037f6 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
@@ -1045,8 +1045,10 @@ public abstract class Inventory extends ItemContainer
*/
public synchronized void addPaperdollListener(PaperdollListener listener)
{
- assert !_paperdollListeners.contains(listener);
- _paperdollListeners.add(listener);
+ if (!_paperdollListeners.contains(listener))
+ {
+ _paperdollListeners.add(listener);
+ }
}
/**
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
index 4e4aa1b790..4b3cd1f785 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
@@ -272,11 +272,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T REMOVE the object from _allObjects of L2World
*
- * Assert :
- *
- * this.isItem().
- * _worldRegion != null (L2Object is visible at the beginning)
- *
* Example of use :
*
* Do Pickup Item : PCInstance and Pet
@@ -285,8 +280,6 @@ public final class L2ItemInstance extends L2Object
*/
public final void pickupMe(L2Character character)
{
- assert getWorldRegion() != null;
-
final L2WorldRegion oldregion = getWorldRegion();
// Create a server->client GetItem packet to pick up the L2ItemInstance
@@ -591,7 +584,6 @@ public final class L2ItemInstance extends L2Object
*/
public int getLocationSlot()
{
- assert (_loc == ItemLocation.PAPERDOLL) || (_loc == ItemLocation.PET_EQUIP) || (_loc == ItemLocation.INVENTORY) || (_loc == ItemLocation.MAIL) || (_loc == ItemLocation.FREIGHT);
return _locData;
}
@@ -1519,10 +1511,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T ADD the object to _allObjects of L2World
*
- * Assert :
- *
- * _worldRegion == null (L2Object is invisible at the beginning)
- *
* Example of use :
*
* Drop item
@@ -1546,8 +1534,6 @@ public final class L2ItemInstance extends L2Object
@Override
public final void run()
{
- assert _itеm.getWorldRegion() == null;
-
if (_dropper != null)
{
final Instance instance = _dropper.getInstanceWorld();
@@ -1597,14 +1583,7 @@ public final class L2ItemInstance extends L2Object
*/
private void updateInDb()
{
- assert _existsInDb;
-
- if (_wear)
- {
- return;
- }
-
- if (_storedInDb)
+ if (!_existsInDb || _wear || _storedInDb)
{
return;
}
@@ -1637,9 +1616,7 @@ public final class L2ItemInstance extends L2Object
*/
private void insertIntoDb()
{
- assert !_existsInDb && (getObjectId() != 0);
-
- if (_wear)
+ if (_existsInDb || (getObjectId() == 0) || _wear)
{
return;
}
@@ -1687,9 +1664,7 @@ public final class L2ItemInstance extends L2Object
*/
private void removeFromDb()
{
- assert _existsInDb;
-
- if (_wear)
+ if (!_existsInDb || _wear)
{
return;
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 5fc4139496..e58ef16934 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -212,7 +212,6 @@ public final class L2WorldRegion
/**
* Add the L2Object in the L2ObjectHashSet(L2Object) _visibleObjects containing L2Object visible in this L2WorldRegion
* If L2Object is a L2PcInstance, Add the L2PcInstance in the L2ObjectHashSet(L2PcInstance) _allPlayable containing L2PcInstance of all player in game in this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this
* @param object
*/
public void addVisibleObject(L2Object object)
@@ -222,7 +221,6 @@ public final class L2WorldRegion
return;
}
- assert object.getWorldRegion() == this;
if (_visibleObjects == null)
{
synchronized (object)
@@ -247,7 +245,6 @@ public final class L2WorldRegion
/**
* Remove the L2Object from the L2ObjectHashSet(L2Object) _visibleObjects in this L2WorldRegion. If L2Object is a L2PcInstance, remove it from the L2ObjectHashSet(L2PcInstance) _allPlayable of this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this || object.getCurrentWorldRegion() == null
* @param object
*/
public void removeVisibleObject(L2Object object)
@@ -257,7 +254,6 @@ public final class L2WorldRegion
return;
}
- assert (object.getWorldRegion() == this) || (object.getWorldRegion() == null);
if (_visibleObjects == null)
{
return;
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
index ab181e2d7e..60402346fa 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
@@ -1065,8 +1065,10 @@ public abstract class Inventory extends ItemContainer
*/
public synchronized void addPaperdollListener(PaperdollListener listener)
{
- assert !_paperdollListeners.contains(listener);
- _paperdollListeners.add(listener);
+ if (!_paperdollListeners.contains(listener))
+ {
+ _paperdollListeners.add(listener);
+ }
}
/**
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
index bdea062b9e..5ba4666031 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
@@ -234,11 +234,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T REMOVE the object from _allObjects of L2World
*
- * Assert :
- *
- * this.isItem().
- * _worldRegion != null (L2Object is visible at the beginning)
- *
* Example of use :
*
* Do Pickup Item : PCInstance and Pet
@@ -247,8 +242,6 @@ public final class L2ItemInstance extends L2Object
*/
public final void pickupMe(L2Character character)
{
- assert getWorldRegion() != null;
-
final L2WorldRegion oldregion = getWorldRegion();
// Create a server->client GetItem packet to pick up the L2ItemInstance
@@ -563,7 +556,6 @@ public final class L2ItemInstance extends L2Object
*/
public int getLocationSlot()
{
- assert (_loc == ItemLocation.PAPERDOLL) || (_loc == ItemLocation.PET_EQUIP) || (_loc == ItemLocation.INVENTORY) || (_loc == ItemLocation.MAIL) || (_loc == ItemLocation.FREIGHT);
return _locData;
}
@@ -1526,10 +1518,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T ADD the object to _allObjects of L2World
*
- * Assert :
- *
- * _worldRegion == null (L2Object is invisible at the beginning)
- *
* Example of use :
*
* Drop item
@@ -1553,8 +1541,6 @@ public final class L2ItemInstance extends L2Object
@Override
public final void run()
{
- assert _itm.getWorldRegion() == null;
-
if (_dropper != null)
{
final Location dropDest = GeoEngine.getInstance().canMoveToTargetLoc(_dropper.getX(), _dropper.getY(), _dropper.getZ(), _x, _y, _z, _dropper.getInstanceId());
@@ -1607,9 +1593,7 @@ public final class L2ItemInstance extends L2Object
*/
private void updateInDb()
{
- assert _existsInDb;
-
- if (_wear || _storedInDb)
+ if (!_existsInDb || _wear || _storedInDb)
{
return;
}
@@ -1642,9 +1626,7 @@ public final class L2ItemInstance extends L2Object
*/
private void insertIntoDb()
{
- assert !_existsInDb && (getObjectId() != 0);
-
- if (_wear)
+ if (_existsInDb || (getObjectId() == 0) || _wear)
{
return;
}
@@ -1688,9 +1670,7 @@ public final class L2ItemInstance extends L2Object
*/
private void removeFromDb()
{
- assert _existsInDb;
-
- if (_wear)
+ if (!_existsInDb || _wear)
{
return;
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 23ae510e98..0850de02ed 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -212,7 +212,6 @@ public final class L2WorldRegion
/**
* Add the L2Object in the L2ObjectHashSet(L2Object) _visibleObjects containing L2Object visible in this L2WorldRegion
* If L2Object is a L2PcInstance, Add the L2PcInstance in the L2ObjectHashSet(L2PcInstance) _allPlayable containing L2PcInstance of all player in game in this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this
* @param object
*/
public void addVisibleObject(L2Object object)
@@ -222,7 +221,6 @@ public final class L2WorldRegion
return;
}
- assert object.getWorldRegion() == this;
if (_visibleObjects == null)
{
synchronized (object)
@@ -247,7 +245,6 @@ public final class L2WorldRegion
/**
* Remove the L2Object from the L2ObjectHashSet(L2Object) _visibleObjects in this L2WorldRegion. If L2Object is a L2PcInstance, remove it from the L2ObjectHashSet(L2PcInstance) _allPlayable of this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this || object.getCurrentWorldRegion() == null
* @param object
*/
public void removeVisibleObject(L2Object object)
@@ -257,7 +254,6 @@ public final class L2WorldRegion
return;
}
- assert (object.getWorldRegion() == this) || (object.getWorldRegion() == null);
if (_visibleObjects == null)
{
return;
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
index 61b8cec043..102306be1b 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
@@ -1045,8 +1045,10 @@ public abstract class Inventory extends ItemContainer
*/
public synchronized void addPaperdollListener(PaperdollListener listener)
{
- assert !_paperdollListeners.contains(listener);
- _paperdollListeners.add(listener);
+ if (!_paperdollListeners.contains(listener))
+ {
+ _paperdollListeners.add(listener);
+ }
}
/**
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
index 47f3378ab9..000d3a0924 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
@@ -272,11 +272,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T REMOVE the object from _allObjects of L2World
*
- * Assert :
- *
- * this.isItem().
- * _worldRegion != null (L2Object is visible at the beginning)
- *
* Example of use :
*
* Do Pickup Item : PCInstance and Pet
@@ -285,8 +280,6 @@ public final class L2ItemInstance extends L2Object
*/
public final void pickupMe(L2Character character)
{
- assert getWorldRegion() != null;
-
final L2WorldRegion oldregion = getWorldRegion();
// Create a server->client GetItem packet to pick up the L2ItemInstance
@@ -591,7 +584,6 @@ public final class L2ItemInstance extends L2Object
*/
public int getLocationSlot()
{
- assert (_loc == ItemLocation.PAPERDOLL) || (_loc == ItemLocation.PET_EQUIP) || (_loc == ItemLocation.INVENTORY) || (_loc == ItemLocation.MAIL) || (_loc == ItemLocation.FREIGHT);
return _locData;
}
@@ -1519,10 +1511,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T ADD the object to _allObjects of L2World
*
- * Assert :
- *
- * _worldRegion == null (L2Object is invisible at the beginning)
- *
* Example of use :
*
* Drop item
@@ -1546,8 +1534,6 @@ public final class L2ItemInstance extends L2Object
@Override
public final void run()
{
- assert _itеm.getWorldRegion() == null;
-
if (_dropper != null)
{
final Instance instance = _dropper.getInstanceWorld();
@@ -1597,14 +1583,7 @@ public final class L2ItemInstance extends L2Object
*/
private void updateInDb()
{
- assert _existsInDb;
-
- if (_wear)
- {
- return;
- }
-
- if (_storedInDb)
+ if (!_existsInDb || _wear || _storedInDb)
{
return;
}
@@ -1637,9 +1616,7 @@ public final class L2ItemInstance extends L2Object
*/
private void insertIntoDb()
{
- assert !_existsInDb && (getObjectId() != 0);
-
- if (_wear)
+ if (_existsInDb || (getObjectId() == 0) || _wear)
{
return;
}
@@ -1687,9 +1664,7 @@ public final class L2ItemInstance extends L2Object
*/
private void removeFromDb()
{
- assert _existsInDb;
-
- if (_wear)
+ if (!_existsInDb || _wear)
{
return;
}
diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 23ae510e98..0850de02ed 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -212,7 +212,6 @@ public final class L2WorldRegion
/**
* Add the L2Object in the L2ObjectHashSet(L2Object) _visibleObjects containing L2Object visible in this L2WorldRegion
* If L2Object is a L2PcInstance, Add the L2PcInstance in the L2ObjectHashSet(L2PcInstance) _allPlayable containing L2PcInstance of all player in game in this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this
* @param object
*/
public void addVisibleObject(L2Object object)
@@ -222,7 +221,6 @@ public final class L2WorldRegion
return;
}
- assert object.getWorldRegion() == this;
if (_visibleObjects == null)
{
synchronized (object)
@@ -247,7 +245,6 @@ public final class L2WorldRegion
/**
* Remove the L2Object from the L2ObjectHashSet(L2Object) _visibleObjects in this L2WorldRegion. If L2Object is a L2PcInstance, remove it from the L2ObjectHashSet(L2PcInstance) _allPlayable of this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this || object.getCurrentWorldRegion() == null
* @param object
*/
public void removeVisibleObject(L2Object object)
@@ -257,7 +254,6 @@ public final class L2WorldRegion
return;
}
- assert (object.getWorldRegion() == this) || (object.getWorldRegion() == null);
if (_visibleObjects == null)
{
return;
diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
index 61b8cec043..102306be1b 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
@@ -1045,8 +1045,10 @@ public abstract class Inventory extends ItemContainer
*/
public synchronized void addPaperdollListener(PaperdollListener listener)
{
- assert !_paperdollListeners.contains(listener);
- _paperdollListeners.add(listener);
+ if (!_paperdollListeners.contains(listener))
+ {
+ _paperdollListeners.add(listener);
+ }
}
/**
diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
index 47f3378ab9..000d3a0924 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
@@ -272,11 +272,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T REMOVE the object from _allObjects of L2World
*
- * Assert :
- *
- * this.isItem().
- * _worldRegion != null (L2Object is visible at the beginning)
- *
* Example of use :
*
* Do Pickup Item : PCInstance and Pet
@@ -285,8 +280,6 @@ public final class L2ItemInstance extends L2Object
*/
public final void pickupMe(L2Character character)
{
- assert getWorldRegion() != null;
-
final L2WorldRegion oldregion = getWorldRegion();
// Create a server->client GetItem packet to pick up the L2ItemInstance
@@ -591,7 +584,6 @@ public final class L2ItemInstance extends L2Object
*/
public int getLocationSlot()
{
- assert (_loc == ItemLocation.PAPERDOLL) || (_loc == ItemLocation.PET_EQUIP) || (_loc == ItemLocation.INVENTORY) || (_loc == ItemLocation.MAIL) || (_loc == ItemLocation.FREIGHT);
return _locData;
}
@@ -1519,10 +1511,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T ADD the object to _allObjects of L2World
*
- * Assert :
- *
- * _worldRegion == null (L2Object is invisible at the beginning)
- *
* Example of use :
*
* Drop item
@@ -1546,8 +1534,6 @@ public final class L2ItemInstance extends L2Object
@Override
public final void run()
{
- assert _itеm.getWorldRegion() == null;
-
if (_dropper != null)
{
final Instance instance = _dropper.getInstanceWorld();
@@ -1597,14 +1583,7 @@ public final class L2ItemInstance extends L2Object
*/
private void updateInDb()
{
- assert _existsInDb;
-
- if (_wear)
- {
- return;
- }
-
- if (_storedInDb)
+ if (!_existsInDb || _wear || _storedInDb)
{
return;
}
@@ -1637,9 +1616,7 @@ public final class L2ItemInstance extends L2Object
*/
private void insertIntoDb()
{
- assert !_existsInDb && (getObjectId() != 0);
-
- if (_wear)
+ if (_existsInDb || (getObjectId() == 0) || _wear)
{
return;
}
@@ -1687,9 +1664,7 @@ public final class L2ItemInstance extends L2Object
*/
private void removeFromDb()
{
- assert _existsInDb;
-
- if (_wear)
+ if (!_existsInDb || _wear)
{
return;
}
diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2WorldRegion.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
index 23ae510e98..0850de02ed 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2WorldRegion.java
@@ -212,7 +212,6 @@ public final class L2WorldRegion
/**
* Add the L2Object in the L2ObjectHashSet(L2Object) _visibleObjects containing L2Object visible in this L2WorldRegion
* If L2Object is a L2PcInstance, Add the L2PcInstance in the L2ObjectHashSet(L2PcInstance) _allPlayable containing L2PcInstance of all player in game in this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this
* @param object
*/
public void addVisibleObject(L2Object object)
@@ -222,7 +221,6 @@ public final class L2WorldRegion
return;
}
- assert object.getWorldRegion() == this;
if (_visibleObjects == null)
{
synchronized (object)
@@ -247,7 +245,6 @@ public final class L2WorldRegion
/**
* Remove the L2Object from the L2ObjectHashSet(L2Object) _visibleObjects in this L2WorldRegion. If L2Object is a L2PcInstance, remove it from the L2ObjectHashSet(L2PcInstance) _allPlayable of this L2WorldRegion
- * Assert : object.getCurrentWorldRegion() == this || object.getCurrentWorldRegion() == null
* @param object
*/
public void removeVisibleObject(L2Object object)
@@ -257,7 +254,6 @@ public final class L2WorldRegion
return;
}
- assert (object.getWorldRegion() == this) || (object.getWorldRegion() == null);
if (_visibleObjects == null)
{
return;
diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
index 66e69d67fa..1f0a5ecd17 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
@@ -1083,8 +1083,10 @@ public abstract class Inventory extends ItemContainer
*/
public synchronized void addPaperdollListener(PaperdollListener listener)
{
- assert !_paperdollListeners.contains(listener);
- _paperdollListeners.add(listener);
+ if (!_paperdollListeners.contains(listener))
+ {
+ _paperdollListeners.add(listener);
+ }
}
/**
diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
index 47f3378ab9..000d3a0924 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java
@@ -272,11 +272,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T REMOVE the object from _allObjects of L2World
*
- * Assert :
- *
- * this.isItem().
- * _worldRegion != null (L2Object is visible at the beginning)
- *
* Example of use :
*
* Do Pickup Item : PCInstance and Pet
@@ -285,8 +280,6 @@ public final class L2ItemInstance extends L2Object
*/
public final void pickupMe(L2Character character)
{
- assert getWorldRegion() != null;
-
final L2WorldRegion oldregion = getWorldRegion();
// Create a server->client GetItem packet to pick up the L2ItemInstance
@@ -591,7 +584,6 @@ public final class L2ItemInstance extends L2Object
*/
public int getLocationSlot()
{
- assert (_loc == ItemLocation.PAPERDOLL) || (_loc == ItemLocation.PET_EQUIP) || (_loc == ItemLocation.INVENTORY) || (_loc == ItemLocation.MAIL) || (_loc == ItemLocation.FREIGHT);
return _locData;
}
@@ -1519,10 +1511,6 @@ public final class L2ItemInstance extends L2Object
*
* Caution : This method DOESN'T ADD the object to _allObjects of L2World
*
- * Assert :
- *
- * _worldRegion == null (L2Object is invisible at the beginning)
- *
* Example of use :
*
* Drop item
@@ -1546,8 +1534,6 @@ public final class L2ItemInstance extends L2Object
@Override
public final void run()
{
- assert _itеm.getWorldRegion() == null;
-
if (_dropper != null)
{
final Instance instance = _dropper.getInstanceWorld();
@@ -1597,14 +1583,7 @@ public final class L2ItemInstance extends L2Object
*/
private void updateInDb()
{
- assert _existsInDb;
-
- if (_wear)
- {
- return;
- }
-
- if (_storedInDb)
+ if (!_existsInDb || _wear || _storedInDb)
{
return;
}
@@ -1637,9 +1616,7 @@ public final class L2ItemInstance extends L2Object
*/
private void insertIntoDb()
{
- assert !_existsInDb && (getObjectId() != 0);
-
- if (_wear)
+ if (_existsInDb || (getObjectId() == 0) || _wear)
{
return;
}
@@ -1687,9 +1664,7 @@ public final class L2ItemInstance extends L2Object
*/
private void removeFromDb()
{
- assert _existsInDb;
-
- if (_wear)
+ if (!_existsInDb || _wear)
{
return;
}