From f12f39bef06b26bd017925f512ef3e8cabc7e402 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Sun, 9 Jun 2024 06:26:10 +0800 Subject: [PATCH] Fixed crash on game save (due to commit 13e0348c) --- sfall/Modules/HeroAppearance.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sfall/Modules/HeroAppearance.cpp b/sfall/Modules/HeroAppearance.cpp index 5e17cf0e..66ef7fe5 100644 --- a/sfall/Modules/HeroAppearance.cpp +++ b/sfall/Modules/HeroAppearance.cpp @@ -300,7 +300,9 @@ static void __stdcall SetHeroArt(bool newArtFlag) { // return hero art val to normal before saving static __declspec(naked) void SavCritNumFix() { __asm { - pushadc; + push ecx; + push edx; + push eax; push 0; // set hero FrmID LST index to normal range before saving call SetHeroArt; pop eax; @@ -308,7 +310,9 @@ static __declspec(naked) void SavCritNumFix() { push eax; push 1; // return hero FrmID LST index back to hero art range after saving hero state structure call SetHeroArt; - popadc; + pop eax; + pop edx; + pop ecx; retn; } }