Update to workOrder cleanup
This commit is contained in:
1 parent
7993fb22d2
commit
c545468f26
1 file changed
+7
-3
@@ -329,12 +329,16 @@ public enum BuildingManager {
|
||||
}
|
||||
|
||||
// Clear all workorders for this hireling
|
||||
if (hireling.getObjectType().equals(GameObjectType.NPC))
|
||||
if (ForgeManager.vendorWorkOrderLookup.contains(hireling))
|
||||
for (WorkOrder workOrder : ForgeManager.vendorWorkOrderLookup.get(hireling)) {
|
||||
if (hireling.getObjectType().equals(GameObjectType.NPC)) {
|
||||
|
||||
NPC hirelingNPC = (NPC) hireling;
|
||||
|
||||
if (ForgeManager.vendorWorkOrderLookup.get(hirelingNPC) != null)
|
||||
for (WorkOrder workOrder : ForgeManager.vendorWorkOrderLookup.get(hirelingNPC)) {
|
||||
workOrder.runCompleted = true;
|
||||
DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder);
|
||||
}
|
||||
}
|
||||
// Remove hireling from building
|
||||
|
||||
building.getHirelings().remove(hireling);
|
||||
|
||||
Reference in new issue
Block a user