Large map manager stream distance is set in editor.

This commit is contained in:
Axel 2022-04-04 17:57:18 +02:00 committed by bernat
parent 56b7bfb3f9
commit e50ffbeea3
1 changed files with 8 additions and 0 deletions

View File

@ -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();