fixed missing food for shared resource games on startup

To claculate limitResourcesToStore() we need to first load all factions. 
Else we get wrong results for  limitResourcesToStore(), and by this sometimes 
no food on startup, depending on the setup.
This commit is contained in:
titiger 2015-01-12 01:46:12 +01:00
parent cd7c367827
commit e4c2683e1d
1 changed files with 5 additions and 1 deletions

View File

@ -2257,7 +2257,11 @@ void World::initUnits() {
placeUnitAtLocation(map.getStartLocation(startLocationIndex), generationArea, unit, true);
}
}
}
// the following is done here in an extra loop and not in the loop above, because shared resources games
// need to load all factions first, before calculating limitResourcesToStore()
for(int i = 0; i < getFactionCount(); ++i) {
Faction *f= factions[i];
// Ensure Starting Resource Amount are adjusted to max store levels
f->limitResourcesToStore();
}