Skip the strongbox of NPC buildings when forging and recycling
Forge submit and vendor recycle took gold from, or refunded gold to, the vendor building's strongbox with no protection check. NPC-city vendors could roll on the static building's 2000 gold. Vendor buy, repair and train already skip NPC buildings. Value changes: forging at a vendor in a protection-NPC building now fails with popup 58; recycling there does nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
afb911cb72
commit
4b50a4f74b
2 files changed
+10
No files matched your search
@@ -131,6 +131,11 @@ public enum ForgeManager implements Runnable {
|
||||
if (city == null)
|
||||
return 58; //58: The formula is beyond the means of this facility
|
||||
|
||||
// NPC buildings have no strongbox to pay from, as in vendor buy, repair and train
|
||||
|
||||
if (workOrder.vendor.building.getProtectionState() == mbEnums.ProtectionState.NPC)
|
||||
return 58;
|
||||
|
||||
// Concurrency is rightly managed by same lock as warehouse
|
||||
|
||||
city.transactionLock.writeLock().lock();
|
||||
|
||||
@@ -299,6 +299,11 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
|
||||
if (vendor.getBuilding() == null)
|
||||
return;
|
||||
|
||||
// NPC buildings have no strongbox to refund into
|
||||
|
||||
if (vendor.getBuilding().getProtectionState() == mbEnums.ProtectionState.NPC)
|
||||
return;
|
||||
|
||||
PlayerCharacter player = origin.getPlayerCharacter();
|
||||
|
||||
if (player == null)
|
||||
|
||||
Reference in new issue
Block a user