Minor code edits to Stats.cpp

This commit is contained in:
NovaRain
2025-05-11 09:32:58 +08:00
parent 5f220d54e4
commit 9355f84943
+7 -6
View File
@@ -51,12 +51,13 @@ static struct StatFormula {
static fo::GameObject* cCritter; static fo::GameObject* cCritter;
static __declspec(naked) void stat_level_hack() { static __declspec(naked) void stat_level_hack() {
static const DWORD StatLevelHack_Ret = 0x4AEF52; using namespace fo;
__asm { __asm {
mov cCritter, eax; mov cCritter, eax;
sub esp, 8; // overwritten engine code
mov ebx, eax; mov esi, edx;
jmp StatLevelHack_Ret; cmp edx, STAT_current_hp;
retn;
} }
} }
@@ -352,7 +353,7 @@ void Stats::init() {
StatsReset(); StatsReset();
MakeJump(0x4AEF4D, stat_level_hack); MakeCall(0x4AEF52, stat_level_hack);
MakeJump(0x4AF3AF, stat_level_hack_check, 2); MakeJump(0x4AF3AF, stat_level_hack_check, 2);
MakeJump(0x4AF571, stat_set_base_hack_check); MakeJump(0x4AF571, stat_set_base_hack_check);