From 588f949cbc4805bde0ee1a320a998d1accafc9cb Mon Sep 17 00:00:00 2001 From: "CVC\\jbelon" Date: Thu, 1 Mar 2018 11:34:56 +0100 Subject: [PATCH] Minor fix with settings and previous merge --- .../Carla/Source/Carla/Settings/CarlaSettings.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Settings/CarlaSettings.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Settings/CarlaSettings.cpp index 4b4a5d5ea..98a36eb78 100755 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Settings/CarlaSettings.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Settings/CarlaSettings.cpp @@ -38,13 +38,11 @@ const FName UCarlaSettings::CARLA_ROAD_TAG = FName("CARLA_ROAD"); // -- Static methods ----------------------------------------------------------- // ============================================================================= -/// Call Callback for every subsection (from top to bottom) in SectionName. -/// Subsections are separated by '/' character. template -static void ForEachSectionInName(const FString &SectionName, T &&Callback) +static void ForEachSectionInName(const FString &SensorName, T &&Callback) { TArray SubSections; - SectionName.ParseIntoArray(SubSections, TEXT("/"), true); + SensorName.ParseIntoArray(SubSections, TEXT("/"), true); check(SubSections.Num() > 0); FString Section = S_CARLA_SENSOR; Callback(Section); @@ -55,8 +53,6 @@ static void ForEachSectionInName(const FString &SectionName, T &&Callback) } } -/// Recursively get sensor type from the ConfigFile for each subsection in -/// SensorName. static FString GetSensorType( const FIniFile &ConfigFile, const FString &SensorName) @@ -68,8 +64,6 @@ static FString GetSensorType( return SensorType; } -/// Recursively load sensor settings from the ConfigFile for each subsection in -/// SensorName. static void LoadSensorFromConfig( const FIniFile &ConfigFile, USensorDescription &Sensor) @@ -409,6 +403,7 @@ void UCarlaSettings::SetAllLightsLowQuality(UWorld* world) const void UCarlaSettings::SetAllRoadsLowQuality(UWorld* world) const { + if(LowRoadMaterials.Num()==0) return; //no materials configured for low quality TArray actors; UGameplayStatics::GetAllActorsWithTag(world, CARLA_ROAD_TAG,actors); for(int32 i=0; i