Skip to content

Commit

Permalink
Merge branch 'master' into better-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
burner1024 committed Oct 10, 2023
2 parents f14b1a9 + e2b5a06 commit 55eb1ec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Build
on:
push:
branches:
- 'master'
- 'develop'
- 'github-action'
paths:
Expand Down
14 changes: 14 additions & 0 deletions sfall/Modules/BugFixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1888,6 +1888,17 @@ static void __declspec(naked) ai_best_weapon_hook() {
}
}

static void __declspec(naked) ai_search_inven_armor_hook() {
__asm {
call fo::funcoffs::item_ar_dt_;
cmp ebx, DMG_electrical;
jne skip;
inc ebx; // skip DMG_emp later
skip:
retn;
}
}

static void __declspec(naked) wmSetupRandomEncounter_hook() {
__asm {
push eax; // text 2
Expand Down Expand Up @@ -3672,6 +3683,9 @@ void BugFixes::init() {
SafeWriteBatch<BYTE>(0x15, {0x42955E, 0x4296E7}); // lea eax, [edx*4] > lea eax, [edx]
}

// Change the calculation of the armor score to exclude the EMP stats (not strictly a bug fix)
HookCalls(ai_search_inven_armor_hook, {0x429ACC, 0x429B17});

// Fix for the encounter description being displayed in two lines instead of one
SafeWrite32(0x4C1011, 0x9090C789); // mov edi, eax;
SafeWrite8(0x4C1015, CodeType::Nop);
Expand Down

0 comments on commit 55eb1ec

Please sign in to comment.