Check that save file have the same amount of cities
This commit is contained in:
parent
196ad2267f
commit
acd0413626
|
@ -1158,6 +1158,15 @@ int wmWorldMap_load(File* stream)
|
||||||
int numCities;
|
int numCities;
|
||||||
if (fileReadInt32(stream, &numCities) == -1) return -1;
|
if (fileReadInt32(stream, &numCities) == -1) return -1;
|
||||||
|
|
||||||
|
bool isCitiesLimitFixEnabled = true;
|
||||||
|
configGetBool(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_CITIES_LIMIT_FIX, &isCitiesLimitFixEnabled);
|
||||||
|
if (isCitiesLimitFixEnabled && numCities != wmMaxAreaNum) {
|
||||||
|
debugPrint("WorldMap Error: Cities limit fix is enabled, "
|
||||||
|
"but the number of cities in the save file is different from "
|
||||||
|
"the number of cities in the worldmap.txt file.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
for (int areaIdx = 0; areaIdx < numCities; areaIdx++) {
|
for (int areaIdx = 0; areaIdx < numCities; areaIdx++) {
|
||||||
CityInfo* city = &(wmAreaInfoList[areaIdx]);
|
CityInfo* city = &(wmAreaInfoList[areaIdx]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue