I have a scenario, where a player is first ClientTravelled to an IP and loads a menu map. They are spawned at load, then seamless traveled to a new map and respawns immediately. Because it’s a work in progress the player is spawned right now in the menu, and the transition from client connection to seamless travel is basically immediate. In this flow though I’ve noticed a crash in the Scene Outliner due to a Move Operation on the client PlayerCharacter object in the scene.
From what I can see, the PlayerCharacter is having a Move operation queued up in the outliner (not sure the source, maybe the top level folder added for the client on connection?), then the seamless travel changes the world to the destination map.
It crashes during the move operation, this is the offending line in ActorHierarchy.cpp is
if (const FSceneOutlinerTreeItemPtr* ParentItem = Items.Find(RepresentingWorld.Get()))
RepresentingWorld is invalid here, but Find will construct an FSceneOutlinerTreeItemID by UObject which does a check for validity, and asserts.
If I bypass the check and continue, once the seamless travel is done and LoadedWorld called, the Outliner then called FullRefresh() which rebuilds with the newly created World.
The simple solution here seems to be an IsValid check in ActorHierarchy, changing the offending section of code to:
// If we get here return world item
UWorld* World = RepresentingWorld.Get();
if (IsValid(World))
{
if (const FSceneOutlinerTreeItemPtr* ParentItem = Items.Find(World))
{
return *ParentItem;
}
else
{
return bCreate ? Mode->CreateItemFor<FWorldTreeItem>(RepresentingWorld.Get(), true) : nullptr;
}
}
return nullptr;