Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/sfall-team/sfall
Browse files Browse the repository at this point in the history
  • Loading branch information
burner1024 committed Feb 12, 2025
2 parents be7d4f6 + 345815e commit ef0b313
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sfall/Modules/BugFixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,15 @@ static __declspec(naked) void gdProcessUpdate_hack() {
}
}

static __declspec(naked) void gdProcessUpdate_hook() {
__asm {
pop edi; // ret addr
call fo::funcoffs::text_to_rect_func_; // return _optionRect.y
mov [ebp + 0x39C], eax; // dialogOptionEntry->bottom = _optionRect.y
jmp edi;
}
}

static __declspec(naked) void invenWieldFunc_item_get_type_hook() {
__asm {
mov edx, esi;
Expand Down Expand Up @@ -3609,6 +3618,9 @@ void BugFixes::init() {
MakeCall(0x447021, gdProcessUpdate_hack, 1);
//}

// Fix for display issues when highlighting a multiline dialogue option
HookCall(0x447071, gdProcessUpdate_hook);

// Fix for "Unlimited Ammo" exploit
dlogr("Applying fix for Unlimited Ammo exploit.", DL_FIX);
HookCall(0x472957, invenWieldFunc_item_get_type_hook); // hooks item_get_type_()
Expand Down

0 comments on commit ef0b313

Please sign in to comment.