diff --git a/extensions/src/multiplayer/networkmanager.cpp b/extensions/src/multiplayer/networkmanager.cpp index fdbe651c..65e8ea1f 100644 --- a/extensions/src/multiplayer/networkmanager.cpp +++ b/extensions/src/multiplayer/networkmanager.cpp @@ -641,12 +641,18 @@ void NetworkManager::NotifyPlayerCountChanged() if (m_inIsleWorld) { count = 0; - // Only count the local player if they have a valid actor - // (players who enter Isle without selecting a save have no actor). + // Only count the local player if they have a valid actor. + // UserActor() can be temporarily NULL during world transitions + // (e.g. returning from a race, where LegoRace stashes the actor + // and only restores it in its destructor). Fall back to the + // GameState actorId which is restored earlier. LegoPathActor* userActor = UserActor(); if (userActor && IsValidActorId(static_cast(userActor)->GetActorId())) { count = 1; } + else if (IsValidActorId(GameState()->GetActorId())) { + count = 1; + } for (auto& [peerId, player] : m_remotePlayers) { if (player->GetWorldId() == (int8_t) LegoOmni::e_act1) {