mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-30 01:41:40 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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<PathfindingComponent>(-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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user