Removed all assertion statements.

This commit is contained in:
MobiusDev
2018-09-03 17:19:02 +00:00
parent 5e7788c4f7
commit 69fd1ac954
24 changed files with 56 additions and 267 deletions

View File

@@ -212,7 +212,6 @@ public final class L2WorldRegion
/**
* Add the L2Object in the L2ObjectHashSet(L2Object) _visibleObjects containing L2Object visible in this L2WorldRegion <BR>
* If L2Object is a L2PcInstance, Add the L2PcInstance in the L2ObjectHashSet(L2PcInstance) _allPlayable containing L2PcInstance of all player in game in this L2WorldRegion <BR>
* 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 <BR>
* 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;

View File

@@ -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);
}
}
/**

View File

@@ -265,11 +265,6 @@ public final class L2ItemInstance extends L2Object
* <BR>
* <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T REMOVE the object from _allObjects of L2World </B></FONT><BR>
* <BR>
* <B><U> Assert </U> :</B><BR>
* <BR>
* <li>this.isItem().</li>
* <li>_worldRegion != null <I>(L2Object is visible at the beginning)</I></li><BR>
* <BR>
* <B><U> Example of use </U> :</B><BR>
* <BR>
* <li>Do Pickup Item : PCInstance and Pet</li><BR>
@@ -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
* <BR>
* <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T ADD the object to _allObjects of L2World </B></FONT><BR>
* <BR>
* <B><U> Assert </U> :</B><BR>
* <BR>
* <li>_worldRegion == null <I>(L2Object is invisible at the beginning)</I></li><BR>
* <BR>
* <B><U> Example of use </U> :</B><BR>
* <BR>
* <li>Drop item</li>
@@ -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;
}