From 1fc38ca6d1f5f2106a1e88b05991b259dbfb1123 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Fri, 22 Nov 2024 12:49:25 +0800 Subject: [PATCH] Added upper limit to WorldMapDelay2 --- artifacts/ddraw.ini | 4 ++-- sfall/Modules/Worldmap.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 60b81099..5c6375b5 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -1,5 +1,5 @@ ;sfall configuration settings -;v4.4.5 +;v4.4.5.1 [Main] ;Set to 1 to enable the built-in High Resolution Patch mode that is similar to the hi-res patch by Mash @@ -277,7 +277,7 @@ WorldMapTimeMod=100 WorldMapFPSPatch=1 ;Controls the world map speed if WorldMapFPSPatch is 1. Higher values cause slower movement -;Default is 66 milliseconds +;Default is 66 milliseconds, and the maximum is 150 WorldMapDelay2=66 ;Set to 1 to enable Ray's patch to make world map encounter rate independent of your travel speed diff --git a/sfall/Modules/Worldmap.cpp b/sfall/Modules/Worldmap.cpp index 210f5e66..4a5135d7 100644 --- a/sfall/Modules/Worldmap.cpp +++ b/sfall/Modules/Worldmap.cpp @@ -22,6 +22,7 @@ #include "..\main.h" #include "..\FalloutEngine\Fallout2.h" +#include "..\Utils.h" #include "LoadGameHook.h" #include "ScriptExtender.h" #include "SpeedPatch.h" @@ -429,8 +430,7 @@ static void WorldmapFpsPatch() { if (IniReader::GetConfigInt("Misc", "WorldMapFPSPatch", 0)) { dlog("Applying world map fps patch.", DL_INIT); if (fpsPatchOK) { - int delay = IniReader::GetConfigInt("Misc", "WorldMapDelay2", 66); - worldMapDelay = max(1, delay); + worldMapDelay = clamp(IniReader::GetConfigInt("Misc", "WorldMapDelay2", 66), 1, 150); dlogr(" Done", DL_INIT); } else { dlogr(" Failed", DL_INIT);