Fixed bugs with copy/pasting instances
This commit is contained in:
parent
09bcf4114c
commit
87906aafb9
|
@ -260,7 +260,7 @@ CScriptObject* CScriptLoader::LoadObjectMP1(IInputStream& rSCLY)
|
|||
}
|
||||
|
||||
u32 InstanceID = rSCLY.ReadLong() & 0x03FFFFFF;
|
||||
if (InstanceID == -1) InstanceID = mpArea->FindUnusedInstanceID();
|
||||
if (InstanceID == 0x03FFFFFF) InstanceID = mpArea->FindUnusedInstanceID();
|
||||
mpObj = new CScriptObject(InstanceID, mpArea, mpLayer, pTemp);
|
||||
|
||||
// Load connections
|
||||
|
@ -374,7 +374,7 @@ CScriptObject* CScriptLoader::LoadObjectMP2(IInputStream& rSCLY)
|
|||
}
|
||||
|
||||
u32 InstanceID = rSCLY.ReadLong() & 0x03FFFFFF;
|
||||
if (InstanceID == -1) InstanceID = mpArea->FindUnusedInstanceID();
|
||||
if (InstanceID == 0x03FFFFFF) InstanceID = mpArea->FindUnusedInstanceID();
|
||||
mpObj = new CScriptObject(InstanceID, mpArea, mpLayer, pTemplate);
|
||||
|
||||
// Load connections
|
||||
|
|
|
@ -116,7 +116,11 @@ void CPasteNodesCommand::redo()
|
|||
}
|
||||
|
||||
else
|
||||
mLinkedInstances << pLink->Receiver();
|
||||
{
|
||||
CScriptObject *pReceiver = pLink->Receiver();
|
||||
pReceiver->AddLink(eIncoming, pLink);
|
||||
mLinkedInstances << pReceiver;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue