mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Added a fix for the display issue in the pipboy when a quest list is too long with UseScrollingQuestsList diabled (from Mr.Stalin)
Added a fix for the clickability issue of holodisk list in the pipboy (from Mr.Stalin)
This commit is contained in:
+1
-1
@@ -366,7 +366,7 @@ Repair=293
|
|||||||
;Remove window position rounding
|
;Remove window position rounding
|
||||||
RemoveWindowRounding=0
|
RemoveWindowRounding=0
|
||||||
|
|
||||||
;Set to 1 to add scroll buttons to the pip boy quest list, and remove the quests per area limit
|
;Set to 1 to add scroll buttons to the pipboy quest list, and remove the quests per area limit
|
||||||
UseScrollingQuestsList=1
|
UseScrollingQuestsList=1
|
||||||
|
|
||||||
;Uncomment these lines to control the premade characters offered when starting a new game
|
;Uncomment these lines to control the premade characters offered when starting a new game
|
||||||
|
|||||||
@@ -68,6 +68,7 @@
|
|||||||
#define FO_VAR_gsound_initialized 0x518E30
|
#define FO_VAR_gsound_initialized 0x518E30
|
||||||
#define FO_VAR_hit_location_penalty 0x510954
|
#define FO_VAR_hit_location_penalty 0x510954
|
||||||
#define FO_VAR_holo_flag 0x664529
|
#define FO_VAR_holo_flag 0x664529
|
||||||
|
#define FO_VAR_holodisk 0x6644F4
|
||||||
#define FO_VAR_holopages 0x66445C
|
#define FO_VAR_holopages 0x66445C
|
||||||
#define FO_VAR_hot_line_count 0x6644F8
|
#define FO_VAR_hot_line_count 0x6644F8
|
||||||
#define FO_VAR_i_fid 0x59E95C
|
#define FO_VAR_i_fid 0x59E95C
|
||||||
@@ -151,6 +152,7 @@
|
|||||||
#define FO_VAR_proto_main_msg_file 0x6647FC
|
#define FO_VAR_proto_main_msg_file 0x6647FC
|
||||||
#define FO_VAR_ptable 0x59E934
|
#define FO_VAR_ptable 0x59E934
|
||||||
#define FO_VAR_pud 0x59E960
|
#define FO_VAR_pud 0x59E960
|
||||||
|
#define FO_VAR_quest_count 0x51C12C
|
||||||
#define FO_VAR_queue 0x6648C0
|
#define FO_VAR_queue 0x6648C0
|
||||||
#define FO_VAR_quick_done 0x5193BC
|
#define FO_VAR_quick_done 0x5193BC
|
||||||
#define FO_VAR_read_callback 0x51DEEC
|
#define FO_VAR_read_callback 0x51DEEC
|
||||||
|
|||||||
@@ -49,6 +49,14 @@ static void __declspec(naked) PipAlarm_hack() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void __declspec(naked) PipStatus_hook() {
|
||||||
|
__asm {
|
||||||
|
call fo::funcoffs::ListHoloDiskTitles_;
|
||||||
|
mov dword ptr ds:[FO_VAR_holodisk], ebx;
|
||||||
|
retn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// corrects saving script blocks (to *.sav file) by properly accounting for actual number of scripts to be saved
|
// corrects saving script blocks (to *.sav file) by properly accounting for actual number of scripts to be saved
|
||||||
static void __declspec(naked) scr_write_ScriptNode_hook() {
|
static void __declspec(naked) scr_write_ScriptNode_hook() {
|
||||||
__asm {
|
__asm {
|
||||||
@@ -1137,9 +1145,13 @@ void BugFixes::init()
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
// Fixes for clickability issue in Pip-Boy and exploit that allows to rest in places where you shouldn't be able to rest
|
// Fixes for clickability issue in Pip-Boy and exploit that allows to rest in places where you shouldn't be able to rest
|
||||||
dlog("Applying fix for Pip-Boy rest exploit.", DL_INIT);
|
dlog("Applying fix for Pip-Boy clickability issues and rest exploit.", DL_INIT);
|
||||||
MakeCall(0x4971C7, pipboy_hack);
|
MakeCall(0x4971C7, pipboy_hack);
|
||||||
MakeCall(0x499530, PipAlarm_hack);
|
MakeCall(0x499530, PipAlarm_hack);
|
||||||
|
// Fix for clickability issue of holodisk list
|
||||||
|
HookCall(0x497E9F, PipStatus_hook);
|
||||||
|
SafeWrite16(0x497E8C, 0xD389); // mov ebx, edx
|
||||||
|
SafeWrite32(0x497E8E, 0x90909090);
|
||||||
dlogr(" Done", DL_INIT);
|
dlogr(" Done", DL_INIT);
|
||||||
|
|
||||||
// Fix for "Too Many Items" bug
|
// Fix for "Too Many Items" bug
|
||||||
|
|||||||
@@ -24,12 +24,40 @@
|
|||||||
namespace sfall
|
namespace sfall
|
||||||
{
|
{
|
||||||
|
|
||||||
|
static bool outRangeFlag = false;
|
||||||
static DWORD calledflag = 0x0;
|
static DWORD calledflag = 0x0;
|
||||||
static DWORD called_quest_number = 0x0;
|
static DWORD called_quest_number = 0x0;
|
||||||
static DWORD total_quests = 0x0;
|
static DWORD total_quests = 0x0;
|
||||||
static DWORD curent_quest_page = 0x0;
|
static DWORD curent_quest_page = 0x0;
|
||||||
static DWORD wait_flag = 0x0;
|
static DWORD wait_flag = 0x0;
|
||||||
|
|
||||||
|
// Fix crash when the quest list is too long
|
||||||
|
static void __declspec(naked) PipStatus_hook_printfix() {
|
||||||
|
__asm {
|
||||||
|
test outRangeFlag, 0xFF;
|
||||||
|
jnz force;
|
||||||
|
call fo::funcoffs::_word_wrap_;
|
||||||
|
push eax;
|
||||||
|
movzx eax, word ptr [esp + 0x49C + 8];
|
||||||
|
dec eax;
|
||||||
|
shl eax, 1;
|
||||||
|
add eax, dword ptr ds:[FO_VAR_cursor_line];
|
||||||
|
cmp eax, dword ptr ds:[FO_VAR_bottom_line]; // check max
|
||||||
|
jb skip;
|
||||||
|
mov eax, dword ptr ds:[FO_VAR_quest_count];
|
||||||
|
sub eax, 2;
|
||||||
|
mov dword ptr [esp + 0x4BC - 0x24 + 8], eax; // set last counter
|
||||||
|
mov outRangeFlag, 1;
|
||||||
|
skip:
|
||||||
|
pop eax;
|
||||||
|
retn;
|
||||||
|
force:
|
||||||
|
or eax, -1; // force log error "out of range"
|
||||||
|
mov outRangeFlag, 0;
|
||||||
|
retn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void __declspec(naked) newhookpress() {
|
static void __declspec(naked) newhookpress() {
|
||||||
__asm {
|
__asm {
|
||||||
push eax;
|
push eax;
|
||||||
@@ -357,10 +385,12 @@ void QuestListPatch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QuestList::init() {
|
void QuestList::init() {
|
||||||
if(GetConfigInt("Misc", "UseScrollingQuestsList", 0)) {
|
if (GetConfigInt("Misc", "UseScrollingQuestsList", 0)) {
|
||||||
dlog("Applying quests list patch ", DL_INIT);
|
dlog("Applying quests list patch ", DL_INIT);
|
||||||
QuestListPatch();
|
QuestListPatch();
|
||||||
dlogr(" Done", DL_INIT);
|
dlogr(" Done", DL_INIT);
|
||||||
|
} else {
|
||||||
|
HookCall(0x498186, PipStatus_hook_printfix); // fix "out of range" bug when printing a list of quests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user