Remove the stupid "-component" garbage from MP1 instance names
This commit is contained in:
parent
f9f6d1f963
commit
4ffd1f0a2d
|
@ -650,6 +650,17 @@ void CAreaLoader::SetUpObjects()
|
|||
CLink *pLink = pObj->Link(eOutgoing, iCon);
|
||||
mConnectionMap[pLink->ReceiverID()].push_back(pLink);
|
||||
}
|
||||
|
||||
// Remove "-component" garbage from MP1 instance names
|
||||
if (mVersion <= ePrime)
|
||||
{
|
||||
TString InstanceName = pObj->InstanceName();
|
||||
|
||||
while (InstanceName.EndsWith("-component"))
|
||||
InstanceName = InstanceName.ChopBack(10);
|
||||
|
||||
pObj->SetName(InstanceName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,13 @@ CScriptObject::CScriptObject(u32 InstanceID, CGameArea *pArea, CScriptLayer *pLa
|
|||
{
|
||||
mpTemplate->AddObject(this);
|
||||
mpProperties = (CPropertyStruct*) pTemplate->BaseStruct()->InstantiateProperty(this, nullptr);
|
||||
|
||||
mpInstanceName = mpTemplate->FindInstanceName(mpProperties);
|
||||
mpPosition = mpTemplate->FindPosition(mpProperties);
|
||||
mpRotation = mpTemplate->FindRotation(mpProperties);
|
||||
mpScale = mpTemplate->FindScale(mpProperties);
|
||||
mpActive = mpTemplate->FindActive(mpProperties);
|
||||
mpLightParameters = mpTemplate->FindLightParameters(mpProperties);
|
||||
}
|
||||
|
||||
CScriptObject::~CScriptObject()
|
||||
|
@ -29,12 +36,6 @@ CScriptObject::~CScriptObject()
|
|||
// ************ DATA MANIPULATION ************
|
||||
void CScriptObject::EvaluateProperties()
|
||||
{
|
||||
mpInstanceName = mpTemplate->FindInstanceName(mpProperties);
|
||||
mpPosition = mpTemplate->FindPosition(mpProperties);
|
||||
mpRotation = mpTemplate->FindRotation(mpProperties);
|
||||
mpScale = mpTemplate->FindScale(mpProperties);
|
||||
mpActive = mpTemplate->FindActive(mpProperties);
|
||||
mpLightParameters = mpTemplate->FindLightParameters(mpProperties);
|
||||
EvaluateDisplayAsset();
|
||||
EvaluateCollisionModel();
|
||||
EvaluateVolume();
|
||||
|
|
Loading…
Reference in New Issue