mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user