From f5a4dfab9a8e42f329b606a7ab33ca167c487c76 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Sat, 28 Nov 2026 05:17:19 -0600 Subject: [PATCH] test(movement): movement AI and pathfinding serialize nothing The client's movement AI and pathfinding control components read no replica data; NPC movement reaches it through the physics component. Co-Authored-By: Claude Opus 5.5 --- .../dComponentsTests/MovementAIPathTests.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/dGameTests/dComponentsTests/MovementAIPathTests.cpp b/tests/dGameTests/dComponentsTests/MovementAIPathTests.cpp index ca6d72322..e97389acd 100644 --- a/tests/dGameTests/dComponentsTests/MovementAIPathTests.cpp +++ b/tests/dGameTests/dComponentsTests/MovementAIPathTests.cpp @@ -6,6 +6,8 @@ #include "dZoneManager.h" #include "Entity.h" #include "MovementAIComponent.h" +#include "PathfindingComponent.h" +#include "BitStream.h" #include "SimplePhysicsComponent.h" #include "Zone.h" #include "ZoneFile.h" @@ -341,3 +343,18 @@ TEST_F(MovementAIPathTest, OncePathEndActionsStopIt) { EXPECT_FALSE(movement->IsWaitingAtWaypoint()); } +// The client's movement AI and pathfinding control components read nothing from the replica: NPC movement goes +// through the physics component +TEST_F(MovementAIPathTest, MovementAIAndPathfindingSerializeNothing) { + Entity entity(320, info); + auto* const movement = Walker(entity); + auto* const pathfinding = entity.AddComponent(-1); + for (const bool construction : { true, false }) { + RakNet::BitStream movementBits; + movement->Serialize(movementBits, construction); + EXPECT_EQ(movementBits.GetNumberOfBitsUsed(), 0u); + RakNet::BitStream pathfindingBits; + pathfinding->Serialize(pathfindingBits, construction); + EXPECT_EQ(pathfindingBits.GetNumberOfBitsUsed(), 0u); + } +}