From 60ff012dfbc765b12836c8592bdc22de96bde8da Mon Sep 17 00:00:00 2001 From: Misha Date: Mon, 3 Jul 2023 18:17:52 +0300 Subject: [PATCH] SetSavePath 100% match --- LEGO1/legogamestate.cpp | 17 +++++++++++++++-- LEGO1/legogamestate.h | 3 +++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/LEGO1/legogamestate.cpp b/LEGO1/legogamestate.cpp index c12a5e06..29b756d1 100644 --- a/LEGO1/legogamestate.cpp +++ b/LEGO1/legogamestate.cpp @@ -1,4 +1,5 @@ #include "legogamestate.h" +#include "legoomni.h" // OFFSET: LEGO1 0x10039550 LegoGameState::LegoGameState() @@ -39,7 +40,19 @@ void LegoGameState::SerializeScoreHistory(MxS16 p) } // OFFSET: LEGO1 0x10039f00 -void LegoGameState::SetSavePath(char *p) +void LegoGameState::SetSavePath(char *p_SavePath) { - // TODO + if (m_SavePath != NULL) + { + delete[] m_SavePath; + } + if (p_SavePath) + { + m_SavePath = new char[strlen(p_SavePath) + 1]; + strcpy(m_SavePath, p_SavePath); + } + else + { + m_SavePath = NULL; + } } diff --git a/LEGO1/legogamestate.h b/LEGO1/legogamestate.h index 80437051..b8f74132 100644 --- a/LEGO1/legogamestate.h +++ b/LEGO1/legogamestate.h @@ -13,6 +13,9 @@ class LegoGameState __declspec(dllexport) void SerializePlayersInfo(MxS16 p); __declspec(dllexport) void SerializeScoreHistory(MxS16 p); __declspec(dllexport) void SetSavePath(char *p); + +private: + char *m_SavePath; }; #endif // LEGOGAMESTATE_H