From e733954e65f69d1b227776e6dbc7fe9c58b8214c Mon Sep 17 00:00:00 2001 From: NovaRain Date: Thu, 23 Jan 2020 20:35:18 +0800 Subject: [PATCH] Removed DisplaySecondWeaponRange from ddraw.ini (always enabled) Minor edits to some code and documents. --- artifacts/ddraw.ini | 5 +---- artifacts/scripting/headers/sfall.h | 6 +++--- sfall/BugFixes.cpp | 4 ++-- sfall/FalloutEngine.cpp | 4 ++-- sfall/ScriptOps/InterfaceOp.hpp | 4 ++-- sfall/main.cpp | 5 +++-- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 157d4a84..92414ff0 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -374,7 +374,7 @@ CorpseDeleteTime=6 ;Set a number of milliseconds to idle each input loop ;Set to -1 to disable -;Set to 0 to idle only if other processes are waiting for processor time +;Set to 0 to idle only if other processes of equal priority are waiting for processor time ;Set to 1 (or some higher number if needed, the maximum is 127) to prevent 100% CPU use ProcessorIdle=-1 @@ -484,9 +484,6 @@ BonusHtHDamageFix=1 ;Set to 1 to display additional points of damage from Bonus HtH/Ranged Damage perks in the inventory DisplayBonusDamage=0 -;Set to 1 to display the range of the second attack mode in the inventory when you switch weapon modes in active item slots -DisplaySecondWeaponRange=1 - ;Modify the maximum number of animations allowed to run on a map. (Default is 32, and the maximum is 127) AnimationsAtOnceLimit=120 diff --git a/artifacts/scripting/headers/sfall.h b/artifacts/scripting/headers/sfall.h index 8f422fe6..ab8779ce 100644 --- a/artifacts/scripting/headers/sfall.h +++ b/artifacts/scripting/headers/sfall.h @@ -70,7 +70,7 @@ #define WINTYPE_DIALOG (1) #define WINTYPE_PIPBOY (2) #define WINTYPE_WORLDMAP (3) -#define WINTYPE_MAINIFACE (4) // the interface bar +#define WINTYPE_IFACEBAR (4) // the interface bar #define WINTYPE_CHARACTER (5) #define WINTYPE_SKILLDEX (6) #define WINTYPE_ESCMENU (7) // escape menu @@ -253,8 +253,8 @@ #define get_current_inven_size(obj) sfall_func1("get_current_inven_size", obj) #define get_cursor_mode sfall_func0("get_cursor_mode") #define get_flags(obj) sfall_func1("get_flags", obj) -#define get_interface_xpos(winType) sfall_func2("get_window_attribute", winType, 0) -#define get_interface_ypos(winType) sfall_func2("get_window_attribute", winType, 1) +#define get_interface_x(winType) sfall_func2("get_window_attribute", winType, 0) +#define get_interface_y(winType) sfall_func2("get_window_attribute", winType, 1) #define get_inven_ap_cost sfall_func0("get_inven_ap_cost") #define get_map_enter_position sfall_func0("get_map_enter_position") #define get_metarule_table sfall_func0("get_metarule_table") diff --git a/sfall/BugFixes.cpp b/sfall/BugFixes.cpp index 8c2ff8f9..dcb0b5f7 100644 --- a/sfall/BugFixes.cpp +++ b/sfall/BugFixes.cpp @@ -101,7 +101,7 @@ isFloat: } static const DWORD UnarmedAttacksFixEnd = 0x423A0D; -static void __declspec(naked) UnarmedAttacksFix() { +static void __declspec(naked) compute_attack_hack() { __asm { mov ecx, 5; // 5% chance of critical hit cmp edx, ATKTYPE_POWERKICK; // Power Kick @@ -2473,7 +2473,7 @@ void BugFixesInit() //if (GetConfigInt("Misc", "SpecialUnarmedAttacksFix", 1)) { dlog("Applying Special Unarmed Attacks fix.", DL_INIT); - MakeJump(0x42394D, UnarmedAttacksFix); + MakeJump(0x42394D, compute_attack_hack); dlogr(" Done", DL_INIT); //} diff --git a/sfall/FalloutEngine.cpp b/sfall/FalloutEngine.cpp index 252b8fc7..639f89d8 100644 --- a/sfall/FalloutEngine.cpp +++ b/sfall/FalloutEngine.cpp @@ -1452,7 +1452,7 @@ enum WinNameType { WINTYPE_Dialog = 1, WINTYPE_PipBoy = 2, WINTYPE_WorldMap = 3, - WINTYPE_MainIface = 4, // the interface bar + WINTYPE_IfaceBar = 4, // the interface bar WINTYPE_Character = 5, WINTYPE_Skilldex = 6, WINTYPE_EscMenu = 7, // escape menu @@ -1473,7 +1473,7 @@ WINinfo* GetUIWindow(long winType) { case WINTYPE_WorldMap: winID = *(DWORD*)_wmBkWin; break; - case WINTYPE_MainIface: + case WINTYPE_IfaceBar: winID = *ptr_interfaceWindow; break; case WINTYPE_Character: diff --git a/sfall/ScriptOps/InterfaceOp.hpp b/sfall/ScriptOps/InterfaceOp.hpp index de05782d..8ba555fe 100644 --- a/sfall/ScriptOps/InterfaceOp.hpp +++ b/sfall/ScriptOps/InterfaceOp.hpp @@ -723,10 +723,10 @@ void sf_get_window_attribute() { } long pos = 0; switch (attrArg.rawValue()) { - case 0 : // x + case 0: // x pos = win->wRect.left; break; - case 1 : // y + case 1: // y pos = win->wRect.top; break; } diff --git a/sfall/main.cpp b/sfall/main.cpp index 549e0258..9e5956ba 100644 --- a/sfall/main.cpp +++ b/sfall/main.cpp @@ -701,11 +701,12 @@ static void DllMain2() { dlogr(" Done", DL_INIT); } - if (GetConfigInt("Misc", "DisplaySecondWeaponRange", 1)) { + // Display the range of the second attack mode in the inventory when you switch weapon modes in active item slots + //if (GetConfigInt("Misc", "DisplaySecondWeaponRange", 1)) { dlog("Applying display second weapon range patch.", DL_INIT); HookCall(0x472201, display_stats_hook); dlogr(" Done", DL_INIT); - } + //} if (GetConfigInt("Misc", "InterfaceDontMoveOnTop", 0)) { dlog("Applying InterfaceDontMoveOnTop patch.", DL_INIT);