mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-28 18:51:16 +00:00
Match 100%
This commit is contained in:
parent
c3ec80114b
commit
84ded1b785
@ -241,21 +241,21 @@ const char* PresenterNameDispatch(const MxDSAction& p_action)
|
|||||||
// FUNCTION: LEGO1 0x100b5410
|
// FUNCTION: LEGO1 0x100b5410
|
||||||
MxEntity* MxPresenter::CreateEntity(const char* p_defaultName)
|
MxEntity* MxPresenter::CreateEntity(const char* p_defaultName)
|
||||||
{
|
{
|
||||||
|
// create an object from LegoObjectFactory based on OBJECT: value in extra data.
|
||||||
|
// If that is missing, p_defaultName is used
|
||||||
|
|
||||||
char objectName[512];
|
char objectName[512];
|
||||||
char buffer[512];
|
|
||||||
|
|
||||||
// create an object from LegoObjectFactory based on OBJECT: value in extra data. If that is missing, p_defaultName
|
|
||||||
// is used
|
|
||||||
|
|
||||||
strcpy(objectName, p_defaultName);
|
strcpy(objectName, p_defaultName);
|
||||||
MxU16 extraLen = m_action->GetExtraLength();
|
|
||||||
|
|
||||||
buffer[0] = extraLen;
|
MxU16 extraLength;
|
||||||
buffer[1] = extraLen >> 8;
|
char* extraData;
|
||||||
if (extraLen & MAXWORD) {
|
m_action->GetExtra(extraLength, extraData);
|
||||||
memcpy(buffer + 2, m_action->GetExtraData(), extraLen & MAXWORD);
|
|
||||||
buffer[extraLen + 2] = 0;
|
if (extraLength & MAXWORD) {
|
||||||
KeyValueStringParse(objectName, g_strOBJECT, buffer + 2);
|
char extraCopy[512];
|
||||||
|
memcpy(extraCopy, extraData, extraLength & MAXWORD);
|
||||||
|
extraCopy[extraLength & MAXWORD] = '\0';
|
||||||
|
KeyValueStringParse(objectName, g_strOBJECT, extraCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (MxEntity*) ObjectFactory()->Create(objectName);
|
return (MxEntity*) ObjectFactory()->Create(objectName);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user