File size: 680 Bytes
24b81cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class Surface
{
	static float GetParamFloat(string surface_name, string param_name)
	{
		return GetGame().ConfigGetFloat("CfgSurfaces " + surface_name + " " + param_name);
	}
	
	static bool AllowedWaterSurface(float pHeight, string pSurface, array<string> pAllowedSurfaceList)
	{
		if (pSurface)
		{
			pSurface.Replace("_ext", "");
			pSurface.Replace("_int", "");
		}

		bool isSeaCheck = false;
		
		foreach (string allowedSurface : pAllowedSurfaceList)
		{
			if (pSurface == "" && allowedSurface == UAWaterType.SEA)
				isSeaCheck = pHeight <= g_Game.SurfaceGetSeaLevel() + 0.001;

			if (isSeaCheck || allowedSurface == pSurface)
				return true;
		}
		
		return false;
	}
}