From 7dc499eb2443316231d60d4947fa0cb9355be7f0 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Tue, 28 May 2024 21:30:52 +0800 Subject: [PATCH] Changed the world map healing rate patch to be enabled by default * default 3 hrs according to Fallout v1.2 manual errata. Changed AIDrugUsePerfFix to be enabled by default (UPU/RPU have it enabled for years, and F2:CE also implemented a similar fix.) Updated version number. --- artifacts/ddraw.ini | 4 ++-- artifacts/scripting/sfall function notes.md | 4 ++-- sfall/Game/combatAI.cpp | 4 ++-- sfall/Modules/BugFixes.cpp | 6 +++--- sfall/Modules/Worldmap.cpp | 2 +- sfall/version.h | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 80733c1f..727ddc33 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -1,5 +1,5 @@ ;sfall configuration settings -;v3.8.43.1 +;v3.8.44 [Main] ;Set to 1 if you want to use command line arguments to tell sfall to use another ini file @@ -775,7 +775,7 @@ AIBestWeaponFix=1 ;Set to 2 to allow NPCs to use only the drugs listed in chem_primary_desire and healing drugs (stimpaks and healing powder) ;Note: chem_primary_desire without fixes prevents the specified item from being consumed if all three values in the list are the same PID ;chem_primary_desire also works as a priority list of drug items the NPC will try to pick up in combat when they are on the ground -AIDrugUsePerfFix=0 +AIDrugUsePerfFix=1 ;Set to 1 to fix the bug of using First Aid/Doctor skills when using them on the player ;This will cause the party member to perform First Aid/Doctor skills when you use them on the player, but only if diff --git a/artifacts/scripting/sfall function notes.md b/artifacts/scripting/sfall function notes.md index 824608fb..7bb53d48 100644 --- a/artifacts/scripting/sfall function notes.md +++ b/artifacts/scripting/sfall function notes.md @@ -1135,8 +1135,8 @@ sfall_funcX metarule functions ---- #### set_worldmap_heal_time `void sfall_func1("set_worldmap_heal_time", int minutes)` -- Sets the time interval in minutes for healing during world map travel -- Passing 0 will revert to 1 second in real time (vanilla engine behavior) +- Sets the time interval in minutes for healing during world map travel. The default is 180 +- Passing 0 will revert to 1 second of real time (vanilla engine behavior) - Passing -1 will disable healing during travel - The time interval will be reset each time the player reloads the game diff --git a/sfall/Game/combatAI.cpp b/sfall/Game/combatAI.cpp index f7cb9040..f797f068 100644 --- a/sfall/Game/combatAI.cpp +++ b/sfall/Game/combatAI.cpp @@ -109,7 +109,7 @@ void __stdcall CombatAI::ai_check_drugs(fo::GameObject* source) { if (counter <= 2) break; // there is a match // [FIX] for AI not taking chem_primary_desire in AI.txt as a preference list when using drugs in the inventory - if (drugUsePerfFixMode == 1) { + if (drugUsePerfFixMode != 2) { counter = 0; item = fo::func::inven_find_type(source, fo::ItemType::item_type_drug, &slot); if (!item) { @@ -202,7 +202,7 @@ void CombatAI::init() { sf::SafeWrite8(0x429BE9, sf::CodeType::JumpNZ); // jz > jnz sf::SafeWrite8(0x429BF1, sf::CodeType::JumpShort); // jnz > jmp - drugUsePerfFixMode = sf::IniReader::GetConfigInt("Misc", "AIDrugUsePerfFix", 0); + drugUsePerfFixMode = sf::IniReader::GetConfigInt("Misc", "AIDrugUsePerfFix", 1); if (drugUsePerfFixMode > 0) sf::dlogr("Applying AI drug use preference fix.", DL_FIX); } diff --git a/sfall/Modules/BugFixes.cpp b/sfall/Modules/BugFixes.cpp index d13b41c1..430cca04 100644 --- a/sfall/Modules/BugFixes.cpp +++ b/sfall/Modules/BugFixes.cpp @@ -2038,7 +2038,7 @@ noRange: static void __declspec(naked) process_rads_hack() { static const DWORD process_rads_Ret = 0x42D708; __asm { - test ebp, ebp; + test ebp, ebp; // modifier: -1 - recovery, 1 - downgrade level jl fix; test byte ptr [ecx + damageFlags], DAM_DEAD; jnz fix; @@ -3925,10 +3925,10 @@ void BugFixes::init() { // Display a pop-up message box about death from radiation HookCall(0x42D733, process_rads_hook_msg); - //int drugUsePerfFix = IniReader::GetConfigInt("Misc", "AIDrugUsePerfFix", 0); + //int drugUsePerfFix = IniReader::GetConfigInt("Misc", "AIDrugUsePerfFix", 1); //if (drugUsePerfFix > 0) { // dlogr("Applying AI drug use preference fix.", DL_FIX); - // if (drugUsePerfFix == 1) { + // if (drugUsePerfFix != 2) { // // Fix for AI not taking chem_primary_desire in AI.txt as a preference list when using drugs in the inventory // MakeCall(0x42869D, ai_check_drugs_hack_break); // MakeCall(0x4286AB, ai_check_drugs_hack_check, 1); diff --git a/sfall/Modules/Worldmap.cpp b/sfall/Modules/Worldmap.cpp index a8c02ace..ac77f9ae 100644 --- a/sfall/Modules/Worldmap.cpp +++ b/sfall/Modules/Worldmap.cpp @@ -57,7 +57,7 @@ static DWORD worldMapTicks; static DWORD WorldMapEncounterRate; -static const long WorldMapHealingDefaultInterval = 0; +static const long WorldMapHealingDefaultInterval = 180 * 60 * 10; // 3 hrs // Healing interval in game time static long worldMapHealingInterval = WorldMapHealingDefaultInterval; static DWORD worldMapLastHealTime; diff --git a/sfall/version.h b/sfall/version.h index cce801e7..7287d61e 100644 --- a/sfall/version.h +++ b/sfall/version.h @@ -24,7 +24,7 @@ #define VERSION_MAJOR 3 #define VERSION_MINOR 8 -#define VERSION_BUILD 43 -#define VERSION_REV 2 +#define VERSION_BUILD 44 +#define VERSION_REV 0 -#define VERSION_STRING "3.8.43.2" +#define VERSION_STRING "3.8.44"