fix(master): a rocket launch preps the clone the player is going to

Launching to a property started an extra clone 0 instance of the zone besides the property's own, because
the prep only carried the zone. PrepZone now carries the clone when there is one (written only then, so a
plain prep is unchanged).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-29 23:11:20 -05:00
parent 1147b61fcb
commit 79d69bf4ac
6 changed files with 30 additions and 7 deletions

View File

@@ -290,6 +290,22 @@ TEST(MasterPacketsTests, WorldStateMatchesLegacy) {
RoundTrip(prep);
ExpectTruncatedFails(prep);
}
{
// A property's clone rides after the zone; a prep without one reads as clone 0
MasterPackets::PrepZone prep;
prep.zoneID = 1251;
prep.cloneID = 2290;
RakNet::BitStream stream;
prep.Serialize(stream);
MasterPackets::PrepZone read;
ASSERT_TRUE(read.Deserialize(stream));
EXPECT_EQ(read.zoneID, 1251);
EXPECT_EQ(read.cloneID, 2290u);
RakNet::BitStream plain;
plain.Write<int32_t>(1100);
ASSERT_TRUE(read.Deserialize(plain));
EXPECT_EQ(read.cloneID, 0u);
}
for (const auto requestID : g_RequestIds) {
MasterPackets::AffirmTransferRequest request;