Browse Source

Update to workOrder cleanup

combat-2
MagicBot 8 months ago
parent
commit
c545468f26
  1. 10
      src/engine/gameManager/BuildingManager.java

10
src/engine/gameManager/BuildingManager.java

@ -329,12 +329,16 @@ public enum BuildingManager {
} }
// Clear all workorders for this hireling // Clear all workorders for this hireling
if (hireling.getObjectType().equals(GameObjectType.NPC)) if (hireling.getObjectType().equals(GameObjectType.NPC)) {
if (ForgeManager.vendorWorkOrderLookup.contains(hireling))
for (WorkOrder workOrder : ForgeManager.vendorWorkOrderLookup.get(hireling)) { NPC hirelingNPC = (NPC) hireling;
if (ForgeManager.vendorWorkOrderLookup.get(hirelingNPC) != null)
for (WorkOrder workOrder : ForgeManager.vendorWorkOrderLookup.get(hirelingNPC)) {
workOrder.runCompleted = true; workOrder.runCompleted = true;
DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder); DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder);
} }
}
// Remove hireling from building // Remove hireling from building
building.getHirelings().remove(hireling); building.getHirelings().remove(hireling);

Loading…
Cancel
Save