City check moved outside of validation
This commit is contained in:
@@ -105,7 +105,13 @@ public enum ForgeManager implements Runnable {
|
||||
if (validation_result != 0)
|
||||
return validation_result;
|
||||
|
||||
// Concurrency is managed by same lock as warehouse
|
||||
|
||||
City city = workOrder.vendor.building.getCity();
|
||||
|
||||
if (city == null)
|
||||
return 58; //58: The formula is beyond the means of this facility
|
||||
|
||||
city.transactionLock.writeLock().lock();
|
||||
|
||||
try {
|
||||
|
||||
@@ -238,9 +238,6 @@ public enum ItemManager {
|
||||
if (workOrder.vendor.getBuilding() == null)
|
||||
return 58; //58: The formula is beyond the means of this facility
|
||||
|
||||
if (workOrder.vendor.getBuilding().getCity() == null)
|
||||
return 58; //58: The formula is beyond the means of this facility
|
||||
|
||||
if (!workOrder.vendor.charItemManager.hasRoomInventory(template.item_wt))
|
||||
return 30; //30: That person cannot carry that item
|
||||
|
||||
|
||||
Reference in New Issue
Block a user