Improve the logic for auto adding the weather component to the terrain (#1238)
This commit is contained in:
committed by
GitHub
parent
e65daa94fe
commit
295b708a81
@@ -474,12 +474,20 @@ namespace wi::terrain
|
||||
modifier->Seed(seed);
|
||||
}
|
||||
|
||||
// Add some nice weather and lighting:
|
||||
if (!scene->weathers.Contains(terrainEntity))
|
||||
// Add some nice weather and lighting if there are no weathers in the scene yet:
|
||||
bool created_terrain_weather = false;
|
||||
if (scene->weathers.GetCount() == 0)
|
||||
{
|
||||
scene->weathers.Create(terrainEntity);
|
||||
if (!scene->weathers.Contains(terrainEntity))
|
||||
{
|
||||
scene->weathers.Create(terrainEntity);
|
||||
created_terrain_weather = true;
|
||||
}
|
||||
}
|
||||
if (created_terrain_weather)
|
||||
{
|
||||
*scene->weathers.GetComponent(terrainEntity) = weather;
|
||||
}
|
||||
*scene->weathers.GetComponent(terrainEntity) = weather;
|
||||
if (!weather.IsOceanEnabled())
|
||||
{
|
||||
scene->ocean = {};
|
||||
|
||||
Reference in New Issue
Block a user