Fixed bugs with copy/pasting instances

This commit is contained in:
Aruki 2017-05-23 19:58:36 -06:00
parent 09bcf4114c
commit 87906aafb9
2 changed files with 7 additions and 3 deletions

View File

@ -260,7 +260,7 @@ CScriptObject* CScriptLoader::LoadObjectMP1(IInputStream& rSCLY)
} }
u32 InstanceID = rSCLY.ReadLong() & 0x03FFFFFF; u32 InstanceID = rSCLY.ReadLong() & 0x03FFFFFF;
if (InstanceID == -1) InstanceID = mpArea->FindUnusedInstanceID(); if (InstanceID == 0x03FFFFFF) InstanceID = mpArea->FindUnusedInstanceID();
mpObj = new CScriptObject(InstanceID, mpArea, mpLayer, pTemp); mpObj = new CScriptObject(InstanceID, mpArea, mpLayer, pTemp);
// Load connections // Load connections
@ -374,7 +374,7 @@ CScriptObject* CScriptLoader::LoadObjectMP2(IInputStream& rSCLY)
} }
u32 InstanceID = rSCLY.ReadLong() & 0x03FFFFFF; u32 InstanceID = rSCLY.ReadLong() & 0x03FFFFFF;
if (InstanceID == -1) InstanceID = mpArea->FindUnusedInstanceID(); if (InstanceID == 0x03FFFFFF) InstanceID = mpArea->FindUnusedInstanceID();
mpObj = new CScriptObject(InstanceID, mpArea, mpLayer, pTemplate); mpObj = new CScriptObject(InstanceID, mpArea, mpLayer, pTemplate);
// Load connections // Load connections

View File

@ -116,7 +116,11 @@ void CPasteNodesCommand::redo()
} }
else else
mLinkedInstances << pLink->Receiver(); {
CScriptObject *pReceiver = pLink->Receiver();
pReceiver->AddLink(eIncoming, pLink);
mLinkedInstances << pReceiver;
}
} }
} }
} }