diff --git a/LEGO1/lego/legoomni/src/common/legogamestate.cpp b/LEGO1/lego/legoomni/src/common/legogamestate.cpp index a24b2e19..6585d2f4 100644 --- a/LEGO1/lego/legoomni/src/common/legogamestate.cpp +++ b/LEGO1/lego/legoomni/src/common/legogamestate.cpp @@ -390,10 +390,7 @@ MxResult LegoGameState::Load(MxULong p_slot) if (count) { for (MxS16 i = 0; i < count; i++) { - MxS16 stateNameLength; - storage.Read(stateNameLength); - storage.Read(stateName, (MxULong) stateNameLength); - stateName[stateNameLength] = 0; + storage.Read(stateName); LegoState* state = GetState(stateName); if (!state) { diff --git a/LEGO1/lego/sources/misc/legostorage.h b/LEGO1/lego/sources/misc/legostorage.h index fa7f6ae4..f46c7a1f 100644 --- a/LEGO1/lego/sources/misc/legostorage.h +++ b/LEGO1/lego/sources/misc/legostorage.h @@ -155,6 +155,15 @@ class LegoFile : public LegoStorage { return this; } + LegoStorage* Read(char* p_data) + { + LegoS16 length; + Read(length); + Read(p_data, length); + p_data[length] = '\0'; + return this; + } + // FUNCTION: LEGO1 0x10034470 LegoStorage* Read(MxString& p_data) {