From 2827ef74ded0ee82bc3793b38e801cdb19599c60 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Mon, 25 Dec 2023 15:22:20 -0500 Subject: [PATCH] Hotfix GetString missing pointer indirection --- LEGO1/legoutil.h | 4 ++-- LEGO1/mxdsmediaaction.cpp | 2 +- LEGO1/mxdsobject.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LEGO1/legoutil.h b/LEGO1/legoutil.h index a6351395..bd7adae6 100644 --- a/LEGO1/legoutil.h +++ b/LEGO1/legoutil.h @@ -49,10 +49,10 @@ inline void GetDouble(MxU8** p_source, T& p_dest) } template -inline void GetString(MxU8** p_source, const char* p_dest, T* p_obj, void (T::*p_setter)(const char*)) +inline void GetString(MxU8** p_source, char** p_dest, T* p_obj, void (T::*p_setter)(const char*)) { (p_obj->*p_setter)((char*) *p_source); - *p_source += strlen(p_dest) + 1; + *p_source += strlen(*p_dest) + 1; } ExtraActionType MatchActionString(const char*); diff --git a/LEGO1/mxdsmediaaction.cpp b/LEGO1/mxdsmediaaction.cpp index 9e07f2d3..fb9425d2 100644 --- a/LEGO1/mxdsmediaaction.cpp +++ b/LEGO1/mxdsmediaaction.cpp @@ -84,7 +84,7 @@ void MxDSMediaAction::Deserialize(MxU8** p_source, MxS16 p_unk0x24) { MxDSAction::Deserialize(p_source, p_unk0x24); - GetString(p_source, this->m_mediaSrcPath, this, &MxDSMediaAction::CopyMediaSrcPath); + GetString(p_source, &this->m_mediaSrcPath, this, &MxDSMediaAction::CopyMediaSrcPath); GetScalar(p_source, this->m_unk0x9c.m_unk0x00); GetScalar(p_source, this->m_unk0x9c.m_unk0x04); GetScalar(p_source, this->m_framesPerSecond); diff --git a/LEGO1/mxdsobject.cpp b/LEGO1/mxdsobject.cpp index fa0b944c..9a5801d1 100644 --- a/LEGO1/mxdsobject.cpp +++ b/LEGO1/mxdsobject.cpp @@ -129,9 +129,9 @@ MxU32 MxDSObject::GetSizeOnDisk() // FUNCTION: LEGO1 0x100bfa20 void MxDSObject::Deserialize(MxU8** p_source, MxS16 p_unk0x24) { - GetString(p_source, this->m_sourceName, this, &MxDSObject::SetSourceName); + GetString(p_source, &this->m_sourceName, this, &MxDSObject::SetSourceName); GetScalar(p_source, this->m_unk0x14); - GetString(p_source, this->m_objectName, this, &MxDSObject::SetObjectName); + GetString(p_source, &this->m_objectName, this, &MxDSObject::SetObjectName); GetScalar(p_source, this->m_objectId); this->m_unk0x24 = p_unk0x24;