Update to validation order.

This commit is contained in:
2024-04-24 13:47:25 -04:00
parent e1d43ce0d0
commit ff2e381999
+14 -12
View File
@@ -96,26 +96,28 @@ public enum ForgeManager implements Runnable {
public static int submit(WorkOrder workOrder) {
// Make sure vendor can roll the formulae, warehouse can
// afford this wordOrder and other related checks.
int validation_result = WorkOrder.validate(workOrder);
// The return code is used by the submitter as a
// popup error message for the player.
if (validation_result != 0)
return validation_result;
// Concurrency is managed by same lock as warehouse
// Must have a city to roll anything
City city = workOrder.vendor.building.getCity();
if (city == null)
return 58; //58: The formula is beyond the means of this facility
// Concurrency is rightly managed by same lock as warehouse
city.transactionLock.writeLock().lock();
// Make sure vendor can roll the formulae, warehouse can
// afford this wordOrder and other related checks.
int validation_result = WorkOrder.validate(workOrder);
// The return code is used by the ItemProductionMsgHandler as a
// popup error message for the player.
if (validation_result != 0)
return validation_result;
try {
// Configure this production run.