Added GetTerrainDef and Sector variant of GetFloorTerrain.
- GetTerrainDef takes the raw number of the Terrains[] index. Can return null. - GetFloorTerrain (Sector) gets the defs from the position given (either Sector.Floor or Sector.Ceiling).
This commit is contained in:
parent
85d68b30bb
commit
579c4152d2
5 changed files with 31 additions and 0 deletions
|
|
@ -938,6 +938,16 @@ int GetTerrain(const sector_t *sector, int pos)
|
|||
return sector->terrainnum[pos] >= 0 ? sector->terrainnum[pos] : TerrainTypes[sector->GetTexture(pos)];
|
||||
}
|
||||
|
||||
FTerrainDef *GetFloorTerrain_S(const sector_t* sec, int pos)
|
||||
{
|
||||
return &Terrains[GetTerrain(sec, pos)];
|
||||
}
|
||||
|
||||
FTerrainDef *GetTerrainDef(const unsigned int num)
|
||||
{
|
||||
return (num >= 0 && num < Terrains.Size()) ? &Terrains[num] : nullptr;
|
||||
}
|
||||
|
||||
//=====================================================================================
|
||||
//
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue