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:
Major Cooke 2022-02-21 18:27:03 -06:00 committed by Christoph Oelckers
commit 579c4152d2
5 changed files with 31 additions and 0 deletions

View file

@ -470,6 +470,19 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, GetTerrain, GetTerrain)
ACTION_RETURN_INT(GetTerrain(self, pos));
}
DEFINE_ACTION_FUNCTION_NATIVE(_Sector, GetFloorTerrain, GetFloorTerrain_S)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(pos);
ACTION_RETURN_POINTER(GetFloorTerrain_S(self, pos));
}
DEFINE_ACTION_FUNCTION_NATIVE(_Sector, GetTerrainDef, GetTerrainDef)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_UINT(floorterrain);
ACTION_RETURN_POINTER(GetTerrainDef(floorterrain));
}
DEFINE_ACTION_FUNCTION_NATIVE(_Sector, CheckPortalPlane, CheckPortalPlane)
{