Skip to content

Commit

Permalink
[dwarfvet] Fix infinite loop if an animal is not accepted at a hospital.
Browse files Browse the repository at this point in the history
  • Loading branch information
BenLubar committed Apr 5, 2018
1 parent a3d4c58 commit 91930a6
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions plugins/dwarfvet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,16 +733,12 @@ void tickHandler(color_ostream& out, void* data) {
// The master list handles all patients which are accepted
// Check if this is a unit we're already aware of

bool patient_accepted = false;
for (vector<AnimalHospital*>::iterator animal_hospital = animal_hospital_zones.begin(); animal_hospital != animal_hospital_zones.end();) {
if ((*animal_hospital)->acceptPatient(unit->id, out)) {
out.print("Accepted patient %d at hospital %d\n", unit->id, (*animal_hospital)->getID());
patient_accepted = true;
for (auto animal_hospital : animal_hospital_zones) {
if (animal_hospital->acceptPatient(unit->id, out)) {
out.print("Accepted patient %d at hospital %d\n", unit->id, animal_hospital->getID());
tracked_units.push_back(unit->id);
break;
}


}
}
}
Expand Down

0 comments on commit 91930a6

Please sign in to comment.