forked from MagicBane/Server
Logic cleanup
This commit is contained in:
@@ -816,6 +816,14 @@ public class Item extends AbstractWorldObject {
|
||||
DbManager.ItemQueries.UPDATE_REMAINING_CHARGES(this);
|
||||
}
|
||||
|
||||
public void zeroItem() {
|
||||
this.ownerID = 0;
|
||||
|
||||
this.ownerType = null;
|
||||
this.containerType = Enum.ItemContainerType.NONE;
|
||||
this.equipSlot = EquipSlotType.NONE;
|
||||
}
|
||||
|
||||
protected void validateItemContainer() {
|
||||
|
||||
if (this.containerType == Enum.ItemContainerType.NONE)
|
||||
@@ -842,15 +850,8 @@ public class Item extends AbstractWorldObject {
|
||||
this.removeFromCache();
|
||||
}
|
||||
|
||||
public synchronized void zeroItem() {
|
||||
this.ownerID = 0;
|
||||
|
||||
this.ownerType = null;
|
||||
this.containerType = Enum.ItemContainerType.NONE;
|
||||
this.equipSlot = EquipSlotType.NONE;
|
||||
}
|
||||
|
||||
protected synchronized boolean moveItemToInventory(PlayerCharacter pc) {
|
||||
|
||||
if (!DbManager.ItemQueries.UPDATE_OWNER(this,
|
||||
pc.getObjectUUID(), //tableID
|
||||
false, //isNPC
|
||||
@@ -858,13 +859,12 @@ public class Item extends AbstractWorldObject {
|
||||
false, //isAccount
|
||||
ItemContainerType.INVENTORY,
|
||||
0)) //Slot
|
||||
|
||||
return false;
|
||||
|
||||
this.zeroItem();
|
||||
this.ownerID = pc.getObjectUUID();
|
||||
this.ownerType = OwnerType.PlayerCharacter;
|
||||
this.containerType = ItemContainerType.INVENTORY;
|
||||
this.equipSlot = EquipSlotType.NONE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user