Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
surface.c
Go to the documentation of this file.
1class Surface
2{
3 static int GetStepsParticleID(string surface_name)
4 {
5 return SurfaceInfo.GetByName(surface_name).GetStepParticleId();
6 }
7
8 static int GetWheelParticleID(string surface_name)
9 {
10 return SurfaceInfo.GetByName(surface_name).GetWheelParticleId();
11 }
12
13 static int GetParamInt(string surface_name, string param_name)
14 {
15 return GetGame().ConfigGetInt("CfgSurfaces " + surface_name + " " + param_name);
16 }
17
18 static float GetParamFloat(string surface_name, string param_name)
19 {
20 return GetGame().ConfigGetFloat("CfgSurfaces " + surface_name + " " + param_name);
21 }
22
23 static string GetParamText(string surfaceName, string paramName)
24 {
25 string output = "";
26 GetGame().ConfigGetText("CfgSurfaces " + surfaceName + " " + paramName, output);
27 return output;
28
29 }
30
31 static bool AllowedWaterSurface(float pHeight, string pSurface, array<string> pAllowedSurfaceList)
32 {
33 if (pSurface)
34 {
35 pSurface.Replace("_ext", "");
36 pSurface.Replace("_int", "");
37 pSurface.Replace("sakhal_", "");
38 }
39
40 bool isSeaCheck = false;
41
42 foreach (string allowedSurface : pAllowedSurfaceList)
43 {
44 if (pSurface == "" && allowedSurface == UAWaterType.SEA)
45 isSeaCheck = pHeight <= (g_Game.SurfaceGetSeaLevel() + 0.25); //MaxWave_default
46
47 if (isSeaCheck || allowedSurface == pSurface)
48 return true;
49 }
50
51 return false;
52 }
53
54 static bool CheckLiquidSource(float pHeight, string pSurface, int allowedWaterSourceMask)
55 {
56 bool success = false;
57 if (pSurface == "")
58 {
59 if ( allowedWaterSourceMask & LIQUID_SALTWATER )
60 {
61 success = pHeight <= (g_Game.SurfaceGetSeaLevel() + 0.25); //MaxWave_default
62 }
63 }
64 else
65 {
66 int liquidType = SurfaceInfo.GetByName(pSurface).GetLiquidType();
67 success = allowedWaterSourceMask & liquidType;
68 }
69
70 return success;
71 }
72}
#define LIQUID_SALTWATER
proto int GetLiquidType()
See 'LiquidTypes' in 'constants.c'.
static proto SurfaceInfo GetByName(string name)
proto int GetStepParticleId()
proto int GetWheelParticleId()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZGame g_Game
Definition dayzgame.c:3868
proto native CGame GetGame()