Fixed the code for "display_stats" script function

Minor edit to Perks.cpp.
This commit is contained in:
NovaRain
2020-06-29 23:02:45 +08:00
parent 440cfbd72c
commit 5dd8c441b9
2 changed files with 6 additions and 7 deletions
+5 -5
View File
@@ -858,11 +858,6 @@ static void PerkEngineInit() {
// perk_owed hooks
MakeCall(0x4AFB2F, LevelUpHack, 1); // replaces 'mov edx, ds:[PlayerLevel]'
SafeWrite8(0x43C2EC, 0xEB); // skip the block of code which checks if the player has gained a perk (now handled in level up code)
// Disable losing unused perks
SafeWrite16(0x43C369, 0x0DFE); // mov ds:[_free_perk], dh > dec ds:[_free_perk]
// If there are unused perks, then call the perk selection window
SafeWrite8(0x43C370, 0xB1); // jmp 0x43C322
}
static void PerkSetup() {
@@ -1465,6 +1460,11 @@ void Perks::init() {
FastShotTraitFix();
// Disable losing unused perks
SafeWrite16(0x43C369, 0x0DFE); // mov ds:[_free_perk], dh > dec ds:[_free_perk]
// If there are unused perks, then call the perk selection window
SafeWrite8(0x43C370, 0xB1); // jmp 0x43C322
// Don't show an empty perk selection window
HookCall(0x43C80B, perks_dialog_hook);
@@ -299,9 +299,9 @@ void mf_display_stats(OpcodeContext& ctx) {
__asm {
mov eax, ds:[FO_VAR_obj_dude];
call fo::funcoffs::stat_recalc_derived_;
xor edx, edx;
mov eax, ds:[FO_VAR_obj_dude];
call fo::funcoffs::critter_adjust_hits_;
push edx;
push ebx;
mov eax, 7;
call fo::funcoffs::PrintBasicStat_;
@@ -310,7 +310,6 @@ void mf_display_stats(OpcodeContext& ctx) {
call fo::funcoffs::PrintLevelWin_;
call fo::funcoffs::ListDrvdStats_;
pop ebx;
pop edx;
}
fo::func::win_draw(fo::var::edit_win);
}