From 44b35adbd6a728322a19e9257e60298c5b02dbcd Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Tue, 10 Nov 2026 14:50:33 -0600 Subject: [PATCH] test: a fractional friction amount of a trigger volume is sent as written LWOPhantomPhysicsComponent::Deserialize (0x00c34db0) reads the effect amount as a 32-bit float, and trigger commands are run by the server only: the client has no parser of its own for "Friction,0.1". The amount stays a float. No live packet of one of the 18 volumes with 0.1 was found, so what live sent for them is not known. Co-Authored-By: Claude Opus 5.5 --- .../dComponentsTests/ReplicaConstructionTests.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/dGameTests/dComponentsTests/ReplicaConstructionTests.cpp b/tests/dGameTests/dComponentsTests/ReplicaConstructionTests.cpp index 9fec20670..7a4d87703 100644 --- a/tests/dGameTests/dComponentsTests/ReplicaConstructionTests.cpp +++ b/tests/dGameTests/dComponentsTests/ReplicaConstructionTests.cpp @@ -317,6 +317,13 @@ TEST_F(ReplicaConstructionTest, PhantomPhysicsVolumeEffectsAsLive) { EXPECT_EQ(effect.type, 4u); EXPECT_FALSE(effect.hasDistance); EXPECT_FALSE(effect.isDirectional); + + // The amount is a float all the way: LWOPhantomPhysicsComponent::Deserialize (0x00c34db0) reads 32 bits into a + // float, and trigger commands are run by the server only, so a fraction is kept as the zone file has it + Entity lowFriction(1007, info); + effect = ReadVolumeEffect(lowFriction, { "Friction", "0.1" }); + EXPECT_EQ(effect.type, 4u); + EXPECT_EQ(effect.amount, 0.1f); } // A construction (the volume coming into one player's range) doesn't use up an effect change the players already