Fixed bug that could produce multiple script instances with equivalent instance IDs

This commit is contained in:
Aruki
2017-05-14 21:30:32 -06:00
parent 77cda50153
commit 43a3558383
6 changed files with 16 additions and 14 deletions

View File

@@ -215,7 +215,8 @@ void CScriptCooker::WriteInstanceMP1(CScriptObject *pInstance)
mpSCLY->WriteLong(0);
u32 InstanceStart = mpSCLY->Tell();
mpSCLY->WriteLong(pInstance->InstanceID());
u32 InstanceID = (pInstance->Layer()->AreaIndex() << 26) | pInstance->InstanceID();
mpSCLY->WriteLong(InstanceID);
mpSCLY->WriteLong(pInstance->NumLinks(eOutgoing));
for (u32 iLink = 0; iLink < pInstance->NumLinks(eOutgoing); iLink++)
@@ -265,7 +266,8 @@ void CScriptCooker::WriteInstanceMP2(CScriptObject *pInstance)
mpSCLY->WriteShort(0);
u32 InstanceStart = mpSCLY->Tell();
mpSCLY->WriteLong(pInstance->InstanceID());
u32 InstanceID = (pInstance->Layer()->AreaIndex() << 26) | pInstance->InstanceID();
mpSCLY->WriteLong(InstanceID);
mpSCLY->WriteShort((u16) pInstance->NumLinks(eOutgoing));
for (u32 iLink = 0; iLink < pInstance->NumLinks(eOutgoing); iLink++)