Logic cleanup

This commit is contained in:
2024-03-09 09:30:58 -05:00
parent c6f451bce1
commit f6fbc6fecb
2 changed files with 27 additions and 22 deletions
+10 -10
View File
@@ -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;
}