forked from MagicBane/Server
NPC buildings dont run out of gold space on buildings
This commit is contained in:
@@ -1519,7 +1519,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
|
||||
int buildingDeposit = cost;
|
||||
|
||||
if (b != null && (b.getStrongboxValue() + buildingDeposit) > b.getMaxGold()) {
|
||||
if (b != null && (b.getStrongboxValue() + buildingDeposit) > b.getMaxGold() && !b.isOwnerIsNPC()) {
|
||||
ErrorPopupMsg.sendErrorPopup(sourcePlayer, 206);
|
||||
return;
|
||||
}
|
||||
@@ -1575,7 +1575,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
b = null;
|
||||
int buildingDeposit = cost;
|
||||
|
||||
if (b != null && (b.getStrongboxValue() + buildingDeposit) > b.getMaxGold()) {
|
||||
if (b != null && (b.getStrongboxValue() + buildingDeposit) > b.getMaxGold() && !b.isOwnerIsNPC()) {
|
||||
ErrorPopupMsg.sendErrorPopup(sourcePlayer, 206);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1399,7 +1399,7 @@ public class CharacterItemManager {
|
||||
if (buildingCity != null) {
|
||||
buildingCity.transactionLock.writeLock().lock();
|
||||
try {
|
||||
if (!vendorBuilding.transferGold(buildingDeposit, true)) {
|
||||
if (!vendorBuilding.isOwnerIsNPC() && !vendorBuilding.transferGold(buildingDeposit, true)) {
|
||||
return false;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -1408,7 +1408,7 @@ public class CharacterItemManager {
|
||||
} finally {
|
||||
buildingCity.transactionLock.writeLock().unlock();
|
||||
}
|
||||
} else if (!vendorBuilding.transferGold(buildingDeposit, true)) {
|
||||
} else if (!vendorBuilding.isOwnerIsNPC() && !vendorBuilding.transferGold(buildingDeposit, true)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user