DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
Surface.c
Go to the documentation of this file.
1class Surface
2{
3 static float GetParamFloat(string surface_name, string param_name)
4 {
5 return GetGame().ConfigGetFloat("CfgSurfaces " + surface_name + " " + param_name);
6 }
7
8 static bool AllowedWaterSurface(float pHeight, string pSurface, array<string> pAllowedSurfaceList)
9 {
10 if (pSurface)
11 {
12 pSurface.Replace("_ext", "");
13 pSurface.Replace("_int", "");
14 }
15
16 bool isSeaCheck = false;
17
18 foreach (string allowedSurface : pAllowedSurfaceList)
19 {
20 if (pSurface == "" && allowedSurface == UAWaterType.SEA)
21 isSeaCheck = pHeight <= g_Game.SurfaceGetSeaLevel() + 0.001;
22
23 if (isSeaCheck || allowedSurface == pSurface)
24 return true;
25 }
26
27 return false;
28 }
29}
DayZGame g_Game
Definition DayZGame.c:3654
proto native float ConfigGetFloat(string path)
Get float value from config on path.
static float GetParamFloat(string surface_name, string param_name)
Definition Surface.c:3
static bool AllowedWaterSurface(float pHeight, string pSurface, array< string > pAllowedSurfaceList)
Definition Surface.c:8
const string SEA
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.