From 21d496f392cf5a6de6dc650024729f31f54380b5 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Mon, 26 Sep 2016 16:05:18 +0800 Subject: [PATCH] Added a new setting to PipBoyAvailableAtGameStart to skip the vault suit movie check and make the PipBoy always available. Improved the functionality of PipBoyAvailableAtGameStart (from Crafty's mod) --- artifacts/ddraw.ini | 1 + sfall/LoadGameHook.cpp | 29 +++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 850a5be8..1d4de1b1 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -247,6 +247,7 @@ Movie17=credits.mve ;PerksFile=Perks.ini ;Set to 1 if you want the pipboy to be available at the start of the game +;Set to 2 to skip the vault suit movie check and make the pipboy always available PipBoyAvailableAtGameStart=0 ;Set to 1 to double the number of available kill types diff --git a/sfall/LoadGameHook.cpp b/sfall/LoadGameHook.cpp index 7217bfbf..4aea07f7 100644 --- a/sfall/LoadGameHook.cpp +++ b/sfall/LoadGameHook.cpp @@ -268,16 +268,17 @@ static void NewGame2() { GainStatFix=0; } - if(GetPrivateProfileInt("Misc", "PipBoyAvailableAtGameStart", 0, ini)) { - SafeWrite8(0x00596C7B, 1); - } - if(GetPrivateProfileInt("Misc", "DisableHorrigan", 0, ini)) { - *(DWORD*)0x00672E04=1; + /*if (GetPrivateProfileInt("Misc", "PipBoyAvailableAtGameStart", 0, ini)) { + SafeWrite8(0x596C7B, 1); + }*/ + if (GetPrivateProfileInt("Misc", "DisableHorrigan", 0, ini)) { + *(DWORD*)0x672E04 = 1; } LoadGlobalScripts(); CritLoad(); } + static void __declspec(naked) NewGame() { __asm { pushad; @@ -293,11 +294,14 @@ static void ReadExtraGameMsgFilesIfNeeded() { ReadExtraGameMsgFiles(); } +static bool PipBoyAvailableAtGameStart = false; static void __declspec(naked) MainMenu() { __asm { pushad; push 0; call ResetState; + mov al, PipBoyAvailableAtGameStart; + mov ds:[_gmovie_played_list+3], al; call ReadExtraGameMsgFilesIfNeeded; call LoadHeroAppearance; popad; @@ -439,13 +443,22 @@ static void __declspec(naked) AutomapHook() { } void LoadGameHookInit() { - SaveInCombatFix=GetPrivateProfileInt("Misc", "SaveInCombatFix", 1, ini); - if(SaveInCombatFix>2) SaveInCombatFix=0; - if(SaveInCombatFix) { + SaveInCombatFix = GetPrivateProfileInt("Misc", "SaveInCombatFix", 1, ini); + if (SaveInCombatFix > 2) SaveInCombatFix = 0; + if (SaveInCombatFix) { GetPrivateProfileString("sfall", "SaveInCombat", "Cannot save at this time", SaveFailMsg, 128, translationIni); } GetPrivateProfileString("sfall", "SaveSfallDataFail", "ERROR saving extended savegame information! Check if other programs interfere with savegame files/folders and try again!", SaveSfallDataFailMsg, 128, translationIni); + switch (GetPrivateProfileInt("Misc", "PipBoyAvailableAtGameStart", 0, ini)) { + case 1: + PipBoyAvailableAtGameStart = true; + break; + case 2: + SafeWrite8(0x497011, 0xEB); // skip the vault suit movie check + break; + } + HookCall(0x480AB3, NewGame); HookCall(0x47C72C, LoadSlot);