From f0784e298719d2ab6a20654d2e4e2e13c0721461 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Thu, 15 Jun 2023 13:40:12 +0800 Subject: [PATCH] Updated the description in [ExtraPatches] for mods_order.txt Tweaked the error log entry for mods_order.txt. Minor code edits. --- artifacts/ddraw.ini | 18 +++++++++++++----- sfall/Modules/LoadOrder.cpp | 2 +- sfall/Modules/PartyControl.cpp | 7 +++---- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 9ee0ab44..79853012 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -15,11 +15,19 @@ UseCommandLine=0 ;This section allows you to set multiple paths to folders containing mods or patches ;Paths to folders and Fallout .dat files are supported ;The PatchFileXX options are available from 0 to 99. Larger numbers take precedence over smaller numbers (same as patchXXX.dat) -;The complete order of how the engine finds game data is: -;master_patches > critter_patches > PatchFile99..PatchFile0 > patchXXX.dat > sfall.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat +;Starting from 4.3.9/3.8.39, the game will load custom .dat files and folders from \mods\mods_order.txt +;The files and folders in mods_order.txt will have a higher priority than the PatchFileXX options +;The complete order of how the engine loads game data is: +;master_patches > critter_patches > mods_order.txt > PatchFileXX > patchXXX.dat > sfall.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat ;PatchFile0=mods\RP_data ;PatchFile1= +;Some details about mods_order.txt: +;If mods_order.txt does not exist, sfall will create one in \mods\ +;To install a new mod, copy the file/folder to \mods\ and add its name to mods_order.txt +;Mods will be loaded line by line from top to bottom. You can change the load order in a text editor +;To disable a mod temporarily, you can comment it out by adding a ';' or '#' to the beginning of the line + ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [Speed] ;Set to 1 to enable options related to the game speed adjustment (SpeedMulti#, SpeedKey#, SpeedModKey, and SpeedToggleKey) @@ -288,9 +296,9 @@ UseFileSystemOverride=0 ;If you want to load multiple patch files (up to 1000) at once, you can include a %d in the file name (sprintf syntax) ;PatchFile=patch%03d.dat -;Set to 1 to change the order of how the engine finds game data -;Original: patchXXX.dat > critter_patches > critter_dat > f2_res_patches > f2_res_dat > master_patches > master_dat -;Modified: master_patches > critter_patches > extra_patches > patchXXX.dat > sfall.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat +;Set to 1 to change the order of how the engine loads game data +;Old: patchXXX.dat > critter_patches > critter_dat > f2_res_patches > f2_res_dat > master_patches > master_dat +;New: master_patches > critter_patches > [ExtraPatches] > patchXXX.dat > sfall.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat ;This option is always enabled in 4.3/3.8.30 or later. The information is left for reference only DataLoadOrderPatch=1 diff --git a/sfall/Modules/LoadOrder.cpp b/sfall/Modules/LoadOrder.cpp index 4d9ae271..0e0cfbb9 100644 --- a/sfall/Modules/LoadOrder.cpp +++ b/sfall/Modules/LoadOrder.cpp @@ -353,7 +353,7 @@ static void GetExtraPatches() { patchFiles.push_back(patch); } } else { - dlog_f("Error opening %s for read: %d\n", DL_MAIN, loadOrderFilePath.c_str() + 2, GetLastError()); + dlog_f("Error opening %s for read: 0x%x\n", DL_MAIN, loadOrderFilePath.c_str() + 2, GetLastError()); } // Remove first duplicates diff --git a/sfall/Modules/PartyControl.cpp b/sfall/Modules/PartyControl.cpp index 352df371..5491ecdb 100644 --- a/sfall/Modules/PartyControl.cpp +++ b/sfall/Modules/PartyControl.cpp @@ -35,7 +35,6 @@ static bool isControllingNPC = false; static char skipCounterAnim; static int delayedExperience; -static bool switchHandHookInjected = false; struct WeaponStateSlot { long npcID; @@ -427,6 +426,7 @@ static void NPCWeaponTweak() { } void PartyControl::SwitchToCritter(fo::GameObject* critter) { + static bool onlyOnce = false; if (skipCounterAnim == 2 && critter && critter == realDude.obj_dude) { skipCounterAnim--; SafeWrite8(0x422BDE, 1); // restore @@ -442,9 +442,8 @@ void PartyControl::SwitchToCritter(fo::GameObject* critter) { } SetCurrentDude(critter); - if (!switchHandHookInjected) { - switchHandHookInjected = true; - //if (!HookScripts::IsInjectHook(HOOK_INVENTORYMOVE)) Inject_SwitchHandHook(); + if (!onlyOnce) { + onlyOnce = true; HookCall(0x49EB09, proto_name_hook);