This commit is contained in:
Vasilii Rogin 2024-04-21 13:14:31 +02:00 committed by GitHub
commit 4b56f22f1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 5 deletions

View File

@ -61,6 +61,7 @@ bool sfallConfigInit(int argc, char** argv)
configSetString(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_VERSION_STRING, "");
configSetString(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_CONFIG_FILE, "");
configSetString(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_PATCH_FILE, "");
configSetBool(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_CITIES_LIMIT_FIX, true);
configSetString(&gSfallConfig, SFALL_CONFIG_SCRIPTS_KEY, SFALL_CONFIG_INI_CONFIG_FOLDER, "");
configSetString(&gSfallConfig, SFALL_CONFIG_SCRIPTS_KEY, SFALL_CONFIG_GLOBAL_SCRIPT_PATHS, "");

View File

@ -75,6 +75,7 @@ namespace fallout {
#define SFALL_CONFIG_VERSION_STRING "VersionString"
#define SFALL_CONFIG_CONFIG_FILE "ConfigFile"
#define SFALL_CONFIG_PATCH_FILE "PatchFile"
#define SFALL_CONFIG_CITIES_LIMIT_FIX "CitiesLimitFix"
#define SFALL_CONFIG_BURST_MOD_DEFAULT_CENTER_MULTIPLIER 1
#define SFALL_CONFIG_BURST_MOD_DEFAULT_CENTER_DIVISOR 3

View File

@ -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;
@ -838,6 +839,12 @@ static void wmSetFlags(int* flagsPtr, int flag, int value)
// 0x4BC89C
int wmWorldMap_init()
{
// SFALL
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);
char path[COMPAT_MAX_PATH];
if (wmGenDataInit() == -1) {
@ -865,10 +872,6 @@ int wmWorldMap_init()
wmMarkSubTileRadiusVisited(wmGenData.worldPosX, wmGenData.worldPosY);
wmWorldMapSaveTempData();
// SFALL
gTownMapHotkeysFix = true;
configGetBool(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_TOWN_MAP_HOTKEYS_FIX_KEY, &gTownMapHotkeysFix);
// 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
@ -1158,6 +1161,13 @@ int wmWorldMap_load(File* stream)
int numCities;
if (fileReadInt32(stream, &numCities) == -1) return -1;
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.");
return -1;
}
for (int areaIdx = 0; areaIdx < numCities; areaIdx++) {
CityInfo* city = &(wmAreaInfoList[areaIdx]);
@ -2530,7 +2540,7 @@ static int wmAreaInit()
configFree(&cfg);
if (wmMaxAreaNum != CITY_COUNT) {
if (!gCitiesLimitFix && wmMaxAreaNum != CITY_COUNT) {
showMesageBox("\nwmAreaInit::Error loading Cities!");
exit(1);
}