From 9fba0bf50bd7aabf0267b74a8f429c8fff917bb3 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 24 Mar 2020 06:12:59 -0400 Subject: [PATCH] CGameState: Set HP value in LoadGameFileState() GM8E v0 stores the HP value of the loaded player state into the returned GameFileStateInfo instance. This prevents the health member from being returned uninitialized. --- Runtime/CGameState.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Runtime/CGameState.cpp b/Runtime/CGameState.cpp index a3c123bdb..d15b41bed 100644 --- a/Runtime/CGameState.cpp +++ b/Runtime/CGameState.cpp @@ -111,6 +111,7 @@ CGameState::GameFileStateInfo CGameState::LoadGameFileState(const u8* data) { CPlayerState playerState(stream); ret.x10_energyTanks = playerState.GetItemCapacity(CPlayerState::EItemType::EnergyTanks); + ret.xc_health = playerState.GetHealthInfo().GetHP(); u32 itemPercent; if (origMLVL == 0x158EFE17)