[dwarfvet] Fix infinite loop if an animal is not accepted at a hospital.

develop
Ben Lubar 2018-04-05 15:01:50 -05:00
parent a3d4c586ab
commit 91930a618f
No known key found for this signature in database
GPG Key ID: 018BAB45DB2D2B24
1 changed files with 3 additions and 7 deletions

@ -733,16 +733,12 @@ processUnits:
// 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;
}
}
}
}