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

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

View File

@ -272,11 +272,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>
@ -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
* <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>
@ -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;
}