From 02f5fae2193f87afcd1f87a942ce1fa4c2cc1081 Mon Sep 17 00:00:00 2001 From: starburst Date: Wed, 18 May 2022 21:34:54 -0500 Subject: [PATCH] Modified so that when you enter a new scene, you keep your mask on :D --- soh/soh/Enhancements/bootcommands.c | 1 + soh/src/code/z_play.c | 2 ++ soh/src/code/z_player_lib.c | 1 + 3 files changed, 4 insertions(+) diff --git a/soh/soh/Enhancements/bootcommands.c b/soh/soh/Enhancements/bootcommands.c index 71bd00cac..383c2f732 100644 --- a/soh/soh/Enhancements/bootcommands.c +++ b/soh/soh/Enhancements/bootcommands.c @@ -31,6 +31,7 @@ void BootCommands_Init() CVar_RegisterS32("gNewDrops", 0); CVar_RegisterS32("gVisualAgony", 0); CVar_RegisterS32("gLanguages", 0); //0 = English / 1 = German / 2 = French + CVar_RegisterS32("gMaskNum", 0); } //void BootCommands_ParseBootArgs(char* str) diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index 632ed41f6..8512c6fb2 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -154,6 +154,8 @@ void Gameplay_Destroy(GameState* thisx) { GlobalContext* globalCtx = (GlobalContext*)thisx; Player* player = GET_PLAYER(globalCtx); + CVar_SetS32("gMaskNum", player->currentMask); + globalCtx->state.gfxCtx->callback = NULL; globalCtx->state.gfxCtx->callbackParam = 0; SREG(91) = 0; diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index 4e4e1ff70..cd615f018 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -412,6 +412,7 @@ void func_8008EC70(Player* this) { void Player_SetEquipmentData(GlobalContext* globalCtx, Player* this) { if (this->csMode != 0x56) { + this->currentMask = CVar_GetS32("gMaskNum", 0); this->currentShield = CUR_EQUIP_VALUE(EQUIP_SHIELD); this->currentTunic = CUR_EQUIP_VALUE(EQUIP_TUNIC) - 1; this->currentBoots = CUR_EQUIP_VALUE(EQUIP_BOOTS) - 1;