diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 36580f99..71e5028c 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -19,14 +19,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) -;Starting from 4.2.6, the game will automatically search and load custom .dat files (or folders named as .dat files) from \mods\ -;The load order of files in the folder will be in reverse alphabetical order of the filenames -;Autoloaded files will have a higher priority than the files specified in the PatchFileXX options -;The complete order of how the engine finds game data is: -;master_patches > critter_patches > mods > 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) @@ -286,9 +291,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/HookScripts/InventoryHs.cpp b/sfall/Modules/HookScripts/InventoryHs.cpp index 35fff1ea..13a2a6e0 100644 --- a/sfall/Modules/HookScripts/InventoryHs.cpp +++ b/sfall/Modules/HookScripts/InventoryHs.cpp @@ -657,15 +657,11 @@ void Inject_MoveCostHook() { HookCalls(MoveCostHook, { 0x417665, 0x44B88A }); } -void Inject_SwitchHandHook() { +void Inject_InventoryMoveHook() { HookCalls(SwitchHandHook, { 0x4712E3, // left slot 0x47136D // right slot }); -} - -void Inject_InventoryMoveHook() { - Inject_SwitchHandHook(); MakeJump(0x4713A9, UseArmorHack); // old 0x4713A3 MakeJump(0x476491, DropIntoContainerHack); MakeJumps(DropIntoContainerHandSlotHack, { 0x471338, 0x4712AB }); diff --git a/sfall/Modules/HookScripts/InventoryHs.h b/sfall/Modules/HookScripts/InventoryHs.h index 7dc8c163..00ab5e56 100644 --- a/sfall/Modules/HookScripts/InventoryHs.h +++ b/sfall/Modules/HookScripts/InventoryHs.h @@ -9,7 +9,6 @@ void InitInventoryHookScripts(); void Inject_RemoveInvenObjHook(); void Inject_MoveCostHook(); -void Inject_SwitchHandHook(); void Inject_InventoryMoveHook(); void Inject_InvenWieldHook(); diff --git a/sfall/Modules/LoadOrder.cpp b/sfall/Modules/LoadOrder.cpp index ab8425df..46464b50 100644 --- a/sfall/Modules/LoadOrder.cpp +++ b/sfall/Modules/LoadOrder.cpp @@ -361,7 +361,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 a13d2c28..04548b44 100644 --- a/sfall/Modules/PartyControl.cpp +++ b/sfall/Modules/PartyControl.cpp @@ -41,7 +41,6 @@ static bool isControllingNPC = false; static char skipCounterAnim; static int delayedExperience; -static bool switchHandHookInjected = false; struct WeaponStateSlot { long npcID; @@ -537,6 +536,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 @@ -577,9 +577,8 @@ void PartyControl::SwitchToCritter(fo::GameObject* critter) { } SetCurrentDude(critter); - if (!switchHandHookInjected) { - switchHandHookInjected = true; - //if (!HookScripts::IsInjectHook(HOOK_INVENTORYMOVE)) Inject_SwitchHandHook(); + if (!onlyOnce) { + onlyOnce = true; ScriptExtender::OnMapExit() += []() { if (!partySneakWorking.empty()) {