diff --git a/src/g_game.cpp b/src/g_game.cpp index 10b4ee4c0..da11adf1d 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -3132,3 +3132,4 @@ DEFINE_GLOBAL(automapactive); DEFINE_GLOBAL(Net_Arbitrator); DEFINE_GLOBAL(netgame); DEFINE_GLOBAL(paused); +DEFINE_GLOBAL(Terrains); diff --git a/src/gamedata/r_defs.h b/src/gamedata/r_defs.h index 2aa79a1fd..d233e09e0 100644 --- a/src/gamedata/r_defs.h +++ b/src/gamedata/r_defs.h @@ -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); diff --git a/src/playsim/p_sectors.cpp b/src/playsim/p_sectors.cpp index e3963272b..bc31156a6 100644 --- a/src/playsim/p_sectors.cpp +++ b/src/playsim/p_sectors.cpp @@ -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; -} - - //===================================================================================== +//===================================================================================== // // //===================================================================================== diff --git a/src/scripting/vmthunks.cpp b/src/scripting/vmthunks.cpp index e35dd43bf..11bee9835 100644 --- a/src/scripting/vmthunks.cpp +++ b/src/scripting/vmthunks.cpp @@ -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); diff --git a/wadsrc/static/zscript/doombase.zs b/wadsrc/static/zscript/doombase.zs index 1670e3b95..34a00cdd4 100644 --- a/wadsrc/static/zscript/doombase.zs +++ b/wadsrc/static/zscript/doombase.zs @@ -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; diff --git a/wadsrc/static/zscript/mapdata.zs b/wadsrc/static/zscript/mapdata.zs index 8b296d994..01bf62b05 100644 --- a/wadsrc/static/zscript/mapdata.zs +++ b/wadsrc/static/zscript/mapdata.zs @@ -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);