Manual weather support

This commit is contained in:
aollero 2022-05-20 13:19:22 +02:00 committed by bernat
parent 5360f2045c
commit f046812746
2 changed files with 6 additions and 1 deletions

View File

@ -126,7 +126,12 @@ void ACarlaGameModeBase::InitGame(
UE_LOG(LogCarla, Error, TEXT("Missing CarlaSettingsDelegate!"));
}
if (WeatherClass != nullptr) {
AActor* WeatherActor =
UGameplayStatics::GetActorOfClass(GetWorld(), AWeather::StaticClass());
if (WeatherActor != nullptr) {
UE_LOG(LogCarla, Log, TEXT("Existing weather actor. Doing nothing then!"));
}
else if (WeatherClass != nullptr) {
Episode->Weather = World->SpawnActor<AWeather>(WeatherClass);
} else {
UE_LOG(LogCarla, Error, TEXT("Missing weather class!"));