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); + } +}