Fixed a problem with direct scenery access in C-API
This commit is contained in:
parent
ce56f0a985
commit
00cbc7f424
2 changed files with 13 additions and 3 deletions
|
@ -233,7 +233,14 @@ void sceneryGetTerrain(TerrainDefinition* terrain)
|
|||
|
||||
TerrainDefinition* sceneryGetTerrainDirect()
|
||||
{
|
||||
if (_main_scenery)
|
||||
{
|
||||
return _main_scenery->getTerrain();
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void scenerySetTextures(TexturesDefinition* textures)
|
||||
|
|
|
@ -71,8 +71,11 @@ static void _layerValidateDefinition(TexturesLayerDefinition* definition)
|
|||
|
||||
/* Update zone height range */
|
||||
TerrainDefinition* terrain = sceneryGetTerrainDirect();
|
||||
if (terrain)
|
||||
{
|
||||
HeightInfo height_info = terrainGetHeightInfo(terrain);
|
||||
zoneSetRelativeHeight(definition->terrain_zone, height_info.min_height, height_info.base_height, height_info.max_height);
|
||||
}
|
||||
}
|
||||
|
||||
static TexturesLayerDefinition* _layerCreateDefinition()
|
||||
|
|
Loading…
Reference in a new issue