Skip to content

Commit

Permalink
Fixed crash on game save (due to commit 13e0348)
Browse files Browse the repository at this point in the history
  • Loading branch information
NovaRain committed Jun 8, 2024
1 parent fd0bd97 commit f12f39b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sfall/Modules/HeroAppearance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,19 @@ 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;
call fo::funcoffs::obj_save_dude_; // save current hero state structure fuction
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;
}
}
Expand Down

0 comments on commit f12f39b

Please sign in to comment.