From 2255d9e9479a5b33854191a84977f02bf96cbaf9 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Wed, 19 Apr 2017 10:37:04 +0800 Subject: [PATCH] Fixed skills being capped at 95% when starting a new game. Changed PipBoyAvailableAtGameStart=1 to be executed before the game starts, so player will be in vault suit at the beginning, instead of first in tribal appearance then switching to vault suit after changing maps. Added a separator line for the new [Scripts] section in ddraw.ini. --- artifacts/ddraw.ini | 5 +++-- sfall/Modules/MiscPatches.cpp | 2 +- sfall/Modules/Skills.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 8caf3b85..77e1bb58 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -98,7 +98,7 @@ ReverseMouseButtons=0 BackgroundKeyboard=0 BackgroundMouse=0 -;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ;The modifier key you have to hold down to change any speed settings ;Set to 0 if you don't want to use a modifier key, or a DX scancode otherwise @@ -133,7 +133,7 @@ ReloadWeaponKey=0 ;A key to press to open a debug game editor DebugEditorKey=0 -;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [Misc] ;Time limit in years. Must be between -3 and 13 @@ -550,6 +550,7 @@ NumbersInDialogue=0 ;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top CreditsAtBottom=0 +;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [Scripts] ;Comma-separated list of masked paths to load global scripts from ;Only use single slash \ as directory separator diff --git a/sfall/Modules/MiscPatches.cpp b/sfall/Modules/MiscPatches.cpp index c1913a16..a4c320ee 100644 --- a/sfall/Modules/MiscPatches.cpp +++ b/sfall/Modules/MiscPatches.cpp @@ -718,7 +718,7 @@ void MusicInDialoguePatch() { void PipboyAvailableAtStartPatch() { switch (GetConfigInt("Misc", "PipBoyAvailableAtGameStart", 0)) { case 1: - LoadGameHook::OnAfterNewGame() += []() { + LoadGameHook::OnBeforeGameStart() += []() { // PipBoy aquiring video fo::var::gmovie_played_list[3] = true; }; diff --git a/sfall/Modules/Skills.cpp b/sfall/Modules/Skills.cpp index 39fe4d41..a880d528 100644 --- a/sfall/Modules/Skills.cpp +++ b/sfall/Modules/Skills.cpp @@ -31,14 +31,14 @@ namespace sfall { -struct ChanceModifier { +struct SkillModifier { DWORD id { 0 }; int maximum { 300 }; int mod { 0 }; }; -static std::vector skillMaxMods; -static ChanceModifier baseSkillMax; +static std::vector skillMaxMods; +static SkillModifier baseSkillMax; static BYTE skillCosts[512 * fo::SKILL_count]; static DWORD basedOnPoints; @@ -114,7 +114,7 @@ void _stdcall SetSkillMax(DWORD critter, DWORD maximum) { return; } } - ChanceModifier cm; + SkillModifier cm; cm.id = critter; cm.maximum = maximum; cm.mod = 0;