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:
+13
-1
@@ -46,6 +46,14 @@ static void __declspec(naked) PipAlarm_hack() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) PipStatus_hook() {
|
||||
__asm {
|
||||
call ListHoloDiskTitles_;
|
||||
mov dword ptr ds:[_holodisk], ebx;
|
||||
retn;
|
||||
}
|
||||
}
|
||||
|
||||
// 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() {
|
||||
__asm {
|
||||
@@ -1162,9 +1170,13 @@ void BugsInit()
|
||||
//}
|
||||
|
||||
// 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(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);
|
||||
|
||||
// Fix for "Too Many Items" bug
|
||||
|
||||
@@ -421,6 +421,7 @@ const DWORD item_w_unload_ = 0x478F80;
|
||||
const DWORD item_weight_ = 0x477B88;
|
||||
const DWORD light_get_tile_ = 0x47A980;
|
||||
const DWORD ListDrvdStats_ = 0x43527C;
|
||||
const DWORD ListHoloDiskTitles_ = 0x498C40;
|
||||
const DWORD ListSkills_ = 0x436154;
|
||||
const DWORD ListTraits_ = 0x43B8A8;
|
||||
const DWORD loadColorTable_ = 0x4C78E4;
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
#define _gsound_initialized 0x518E30
|
||||
#define _hit_location_penalty 0x510954
|
||||
#define _holo_flag 0x664529
|
||||
#define _holodisk 0x6644F4
|
||||
#define _holopages 0x66445C
|
||||
#define _hot_line_count 0x6644F8
|
||||
#define _i_fid 0x59E95C
|
||||
@@ -168,6 +169,7 @@
|
||||
#define _proto_main_msg_file 0x6647FC
|
||||
#define _ptable 0x59E934
|
||||
#define _pud 0x59E960
|
||||
#define _quest_count 0x51C12C
|
||||
#define _queue 0x6648C0
|
||||
#define _quick_done 0x5193BC
|
||||
#define _read_callback 0x51DEEC
|
||||
@@ -597,6 +599,7 @@ extern const DWORD item_w_unload_;
|
||||
extern const DWORD item_weight_;
|
||||
extern const DWORD light_get_tile_; // aElev<eax>, aTilenum<edx>
|
||||
extern const DWORD ListDrvdStats_;
|
||||
extern const DWORD ListHoloDiskTitles_;
|
||||
extern const DWORD ListSkills_;
|
||||
extern const DWORD ListTraits_;
|
||||
extern const DWORD loadColorTable_;
|
||||
|
||||
@@ -538,6 +538,34 @@ end:
|
||||
}
|
||||
}
|
||||
|
||||
// Fix crash when the quest list is too long
|
||||
static bool outRangeFlag = false;
|
||||
static void __declspec(naked) PipStatus_hook_printfix() {
|
||||
__asm {
|
||||
test outRangeFlag, 0xFF;
|
||||
jnz force;
|
||||
call _word_wrap_;
|
||||
push eax;
|
||||
movzx eax, word ptr [esp + 0x49C + 8];
|
||||
dec eax;
|
||||
shl eax, 1;
|
||||
add eax, dword ptr ds:[_cursor_line];
|
||||
cmp eax, dword ptr ds:[_bottom_line]; // check max
|
||||
jb skip;
|
||||
mov eax, dword ptr ds:[_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) intface_rotate_numbers_hack() {
|
||||
__asm {
|
||||
push edi
|
||||
@@ -1254,6 +1282,8 @@ static void DllMain2() {
|
||||
dlog("Applying quests list patch.", DL_INIT);
|
||||
QuestListInit();
|
||||
dlogr(" Done", DL_INIT);
|
||||
} else {
|
||||
HookCall(0x498186, PipStatus_hook_printfix); // fix "out of range" bug when printing a list of quests
|
||||
}
|
||||
|
||||
dlog("Applying premade characters patch.", DL_INIT);
|
||||
|
||||
Reference in New Issue
Block a user