Skip to content

Commit fd04e57

Browse files
committed
cloning: apply a pending clone sync before changing ownership of a migrating object
1 parent 61dec4f commit fd04e57

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

code/components/gta-net-five/src/CloneManager.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -903,9 +903,6 @@ bool CloneManagerLocal::HandleCloneUpdate(const msgClone& msg)
903903

904904
auto obj = objIt->second;
905905

906-
// update client id if changed
907-
CheckMigration(msg);
908-
909906
if (msg.GetClientId() == m_netLibrary->GetServerNetID())
910907
{
911908
Log("%s: our object, bailing out\n", __func__);
@@ -952,6 +949,10 @@ bool CloneManagerLocal::HandleCloneUpdate(const msgClone& msg)
952949
// call post-apply
953950
obj->m_1D0();
954951

952+
// update client id if changed
953+
// this has to be done AFTER apply since the sync update might contain critical state we didn't have yet!
954+
CheckMigration(msg);
955+
955956
ackPacket();
956957

957958
return true;

0 commit comments

Comments
 (0)