From e50ffbeea3e208c8c8b2d6f2069d7d17d8a5e3eb Mon Sep 17 00:00:00 2001 From: Axel Date: Mon, 4 Apr 2022 17:57:18 +0200 Subject: [PATCH] Large map manager stream distance is set in editor. --- .../Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp index 8137b2dbe..d6ce0f353 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp @@ -91,6 +91,14 @@ void FCarlaEngine::NotifyBeginEpisode(UCarlaEpisode &Episode) Episode.EpisodeSettings.FixedDeltaSeconds = FCarlaEngine_GetFixedDeltaSeconds(); CurrentEpisode = &Episode; + // Reset map settings + UWorld* World = CurrentEpisode->GetWorld(); + ALargeMapManager* LargeMapManager = UCarlaStatics::GetLargeMapManager(World); + if (LargeMapManager) + { + CurrentSettings.TileStreamingDistance = LargeMapManager->GetLayerStreamingDistance(); + CurrentSettings.ActorActiveDistance = LargeMapManager->GetActorStreamingDistance(); + } CurrentEpisode->ApplySettings(CurrentSettings); ResetFrameCounter();