Skip to content

Commit

Permalink
Use gCitiesLimitFix variable
Browse files Browse the repository at this point in the history
  • Loading branch information
roginvs committed Apr 18, 2024
1 parent acd0413 commit db07e95
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/worldmap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ static int wmMaxEncBaseTypes;
static int wmMaxEncounterInfoTables;

static bool gTownMapHotkeysFix;
static bool gCitiesLimitFix;
static double gGameTimeIncRemainder = 0.0;
static FrmImage _backgroundFrmImage;
static FrmImage _townFrmImage;
Expand Down Expand Up @@ -869,6 +870,9 @@ int wmWorldMap_init()
gTownMapHotkeysFix = true;
configGetBool(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_TOWN_MAP_HOTKEYS_FIX_KEY, &gTownMapHotkeysFix);

gCitiesLimitFix = true;
configGetBool(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_CITIES_LIMIT_FIX, &gCitiesLimitFix);

// CE: City size fids should be initialized during startup. They are used
// during |wmTeleportToArea| to calculate worldmap position when jumping
// from Temple to Arroyo - before giving a chance to |wmInterfaceInit| to
Expand Down Expand Up @@ -1158,9 +1162,7 @@ int wmWorldMap_load(File* stream)
int numCities;
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) {
if (gCitiesLimitFix && 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.");
Expand Down Expand Up @@ -2539,10 +2541,7 @@ static int wmAreaInit()

configFree(&cfg);

bool isCitiesLimitFixEnabled = true;
configGetBool(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_CITIES_LIMIT_FIX, &isCitiesLimitFixEnabled);

if (!isCitiesLimitFixEnabled && wmMaxAreaNum != CITY_COUNT) {
if (!gCitiesLimitFix && wmMaxAreaNum != CITY_COUNT) {
showMesageBox("\nwmAreaInit::Error loading Cities!");
exit(1);
}
Expand Down

0 comments on commit db07e95

Please sign in to comment.