We are experiencing crashes in UE 5.6 when simulated proxy pawns are removed before UMassAgentComponent::OnRep_NetID() has run. In this case, UMassAgentComponent::UnregisterWithAgentSubsystem() is called while the component is still in the PuppetPendingReplication state, which fails the MASSAGENT_CHECK assertion and crashes the client.This seems to match the issue reported in the public Unreal Engine forums: https://forums.unrealengine.com/t/ue-5-6-massagentcomponent-bug/2607675
unknown 0x00004000 / 0x7ffe3dbe9f0a: Fatal Error: unknown 0x00004000 / 0x7ffe3dbe9f0a
?, in UMassAgentComponent::UnregisterWithAgentSubsystem
?, in UMassAgentComponent::OnUnregister
File "ActorComponent.cpp", line 1843, in UActorComponent::ExecuteUnregisterEvents
File "ActorComponent.cpp", line 1553, in UActorComponent::UnregisterComponent
File "Actor.cpp", line 5473, in AActor::UnregisterAllComponents
...
(45 additional frame(s) were not displayed)
Assertion failed: State == EAgentComponentState::None || State == EAgentComponentState::PuppetPaused || State == EAgentComponentState::PuppetReplicatedOrphan [File:D:\Horde\Work\ULIncMain\Sync\Engine\Plugins\Runtime\MassGameplay\Source\MassActors\Private\MassAgentComponent.cpp] [Line: 131]
UMassAgentComponent::UnregisterWithAgentSubsystem is expecting to be in state[None|PuppetPaused|PuppetReplicatedOrphan] state but is in EAgentComponentState::PuppetPendingReplication