diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index 5798dc737..56e752660 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -632,7 +632,7 @@ void EraseScreen(int nVal) bool GameInterface::CanSave() { - return gamestate == GS_LEVEL && !bRecord && !bPlayback && !paused && !bInDemo && nTotalPlayers == 1; + return gamestate == GS_LEVEL && !bRecord && !bPlayback && !paused && !bInDemo && nTotalPlayers == 1 && nFreeze == 0; } ::GameStats GameInterface::getStats() diff --git a/source/exhumed/src/ra.cpp b/source/exhumed/src/ra.cpp index e570a2290..8718fbf33 100644 --- a/source/exhumed/src/ra.cpp +++ b/source/exhumed/src/ra.cpp @@ -29,7 +29,6 @@ BEGIN_PS_NS /* bjd - the content of the ra.* files originally resided in gun.c I think... */ RA Ra[kMaxPlayers]; // one Ra for each player -short RaCount; static actionSeq RaSeq[] = { {2, 1}, @@ -38,12 +37,29 @@ static actionSeq RaSeq[] = { {2, 0} }; -static SavegameHelper sghra("ra", - SA(Ra), - SV(RaCount), - nullptr); +FSerializer& Serialize(FSerializer& arc, const char* keyname, RA& w, RA* def) +{ + if (arc.BeginObject(keyname)) + { + arc ("frame", w.nFrame) + ("action", w.nAction) + ("sprite", w.nSprite) + ("target", w.nTarget) + ("run", w.nRun) + ("ata", w.field_A) + ("atc", w.field_C) + ("player", w.nPlayer) + .EndObject(); + } + return arc; +} +void SerializeRa(FSerializer& arc) +{ + arc.Array("ra", Ra, PlayerCount); +} + void FreeRa(short nPlayer) { int nRun = Ra[nPlayer].nRun; @@ -93,7 +109,6 @@ int BuildRa(short nPlayer) void InitRa() { - RaCount = 0; memset(Ra, 0, sizeof(RA) * kMaxPlayers); } diff --git a/source/exhumed/src/ramses.cpp b/source/exhumed/src/ramses.cpp index 7a4c03300..9e8d35398 100644 --- a/source/exhumed/src/ramses.cpp +++ b/source/exhumed/src/ramses.cpp @@ -451,34 +451,4 @@ void DoSpiritHead() } } -// This is only the static global data. -static SavegameHelper sghramses("ramses", - SA(cPupData), - SV(nPupData), - SV(nPixels), - SA(curx), - SA(cury), - SA(destvelx), - SA(destvely), - SA(pixelval), - SA(origy), - SA(origx), - SA(velx), - SA(vely), - SV(nMouthTile), - SV(nSpiritSprite), - SV(word_964E8), - SV(word_964EA), - SV(word_964EC), - SV(nSpiritRepeatX), - SV(nSpiritRepeatY), - SV(nPixelsToShow), - SV(nTalkTime), - SV(lHeadStartClock), - SV(lNextStateChange), - SV(nHeadStage), - SV(nHeadTimeStart), - nullptr - ); - END_PS_NS diff --git a/source/exhumed/src/save.cpp b/source/exhumed/src/save.cpp index be84a682f..169690e6e 100644 --- a/source/exhumed/src/save.cpp +++ b/source/exhumed/src/save.cpp @@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_PS_NS +void SerializeRa(FSerializer& arc); void SerializeRand(FSerializer& arc); void SerializeRunList(FSerializer& arc); void SerializeSequence(FSerializer& arc); @@ -65,6 +66,7 @@ void GameInterface::SerializeGameState(FSerializer& arc) { if (arc.BeginObject("exhumed")) { + SerializeRa(arc); SerializeRand(arc); SerializeRunList(arc); SerializeSequence(arc);