Hotfix GetString missing pointer indirection

This commit is contained in:
Christian Semmler 2023-12-25 15:22:20 -05:00
parent 762681a821
commit 2827ef74de
No known key found for this signature in database
GPG key ID: 086DAA1360BEEE5C
3 changed files with 5 additions and 5 deletions

View file

@ -49,10 +49,10 @@ inline void GetDouble(MxU8** p_source, T& p_dest)
} }
template <class T> template <class T>
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_obj->*p_setter)((char*) *p_source);
*p_source += strlen(p_dest) + 1; *p_source += strlen(*p_dest) + 1;
} }
ExtraActionType MatchActionString(const char*); ExtraActionType MatchActionString(const char*);

View file

@ -84,7 +84,7 @@ void MxDSMediaAction::Deserialize(MxU8** p_source, MxS16 p_unk0x24)
{ {
MxDSAction::Deserialize(p_source, 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_unk0x00);
GetScalar(p_source, this->m_unk0x9c.m_unk0x04); GetScalar(p_source, this->m_unk0x9c.m_unk0x04);
GetScalar(p_source, this->m_framesPerSecond); GetScalar(p_source, this->m_framesPerSecond);

View file

@ -129,9 +129,9 @@ MxU32 MxDSObject::GetSizeOnDisk()
// FUNCTION: LEGO1 0x100bfa20 // FUNCTION: LEGO1 0x100bfa20
void MxDSObject::Deserialize(MxU8** p_source, MxS16 p_unk0x24) 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); 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); GetScalar(p_source, this->m_objectId);
this->m_unk0x24 = p_unk0x24; this->m_unk0x24 = p_unk0x24;