New Handler created for SELLOBJECT

This commit is contained in:
2024-03-24 09:18:05 -04:00
parent 3fc5fa71a4
commit 67e0766894
4 changed files with 216 additions and 176 deletions
+7 -4
View File
@@ -1315,8 +1315,8 @@ public class CharacterItemManager {
} finally {
buildingCity.transactionLock.writeLock().unlock();
}
} else if (!vendorBuilding.transferGold(buildingDeposit, true))
return false;
} else
return vendorBuilding.transferGold(buildingDeposit, true);
return true;
}
@@ -1382,8 +1382,10 @@ public class CharacterItemManager {
synchronized (this) {
synchronized (itemMan) {
if (!this.doesCharOwnThisItem(itemToSell.getObjectUUID()))
return false;
// attempt to transfer item in db
boolean sdrMerchant = false;
@@ -1398,13 +1400,14 @@ public class CharacterItemManager {
} else if (!itemToSell.moveItemToInventory(npc))
return false;
// db transfer successfull, remove from this character
// skip this check if this is a mobLoot item (which is not in any inventory)
if (!sdrMerchant)
if (!removeItemFromInventory(itemToSell))
return false;
// add item to looter.
// add item to vendor
if (!sdrMerchant)
if (!itemMan.addItemToInventory(itemToSell))
return false;