Replaced GetTerrainDef with the global Terrains array.

This commit is contained in:
Major Cooke 2022-02-22 09:32:08 -06:00 committed by Christoph Oelckers
parent 8a61badcad
commit 421c40e929
6 changed files with 3 additions and 15 deletions

View file

@ -3132,3 +3132,4 @@ DEFINE_GLOBAL(automapactive);
DEFINE_GLOBAL(Net_Arbitrator);
DEFINE_GLOBAL(netgame);
DEFINE_GLOBAL(paused);
DEFINE_GLOBAL(Terrains);

View file

@ -1771,7 +1771,6 @@ void GetSpecial(sector_t *self, secspecial_t *spec);
void SetSpecial(sector_t *self, const secspecial_t *spec);
int GetTerrain(const sector_t *, int pos);
FTerrainDef *GetFloorTerrain_S(const sector_t* sec, int pos);
FTerrainDef *GetTerrainDef(const unsigned int num);
void CheckPortalPlane(sector_t *sector, int plane);
void AdjustFloorClip(const sector_t *sector);
void SetColor(sector_t *sector, int color, int desat);

View file

@ -943,12 +943,7 @@ 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;
}
//=====================================================================================
//=====================================================================================
//
//
//=====================================================================================

View file

@ -477,13 +477,6 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, GetFloorTerrain, GetFloorTerrain_S)
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)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);

View file

@ -5,6 +5,7 @@ extend struct _
native readonly Array<@PlayerClass> PlayerClasses;
native readonly Array<@PlayerSkin> PlayerSkins;
native readonly Array<@Team> Teams;
native readonly Array<@TerrainDef> Terrains;
native int validcount;
native play @DehInfo deh;
native readonly bool automapactive;

View file

@ -452,7 +452,6 @@ struct Sector native play
native void GetSpecial(out SecSpecial spec);
native void SetSpecial( SecSpecial spec);
native int GetTerrain(int pos);
native TerrainDef GetTerrainDef(uint floorterrain); // Gets the terraindef from the number (such as an actor's floorterrain). May return null!
native TerrainDef GetFloorTerrain(int pos); // Gets the terraindef from floor/ceiling (see EPlane const).
native void CheckPortalPlane(int plane);
native double, Sector HighestCeilingAt(Vector2 a);