/
SN1054NGC
/
DayZ_Projects_cpp
Обзор
Документация
Войти
/
SN1054NGC
/
DayZ_Projects_cpp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
scripts/4_world/static/surface.c
73 строки
2 KB
SN1054NGC
Initial DayZ mod project commit
26 ноя 2025, 01:03
26 ноя 2025, 01:03
fddb039
Код
Авторство
О чём код?
class Surface { static int GetStepsParticleID(string surface_name) { return SurfaceInfo.GetByName(surface_name).GetStepParticleId(); } static int GetWheelParticleID(string surface_name) { return SurfaceInfo.GetByName(surface_name).GetWheelParticleId(); } static int GetParamInt(string surface_name, string param_name) { return GetGame().ConfigGetInt("CfgSurfaces " + surface_name + " " + param_name); } static float GetParamFloat(string surface_name, string param_name) { return GetGame().ConfigGetFloat("CfgSurfaces " + surface_name + " " + param_name); } static string GetParamText(string surfaceName, string paramName) { string output = ""; GetGame().ConfigGetText("CfgSurfaces " + surfaceName + " " + paramName, output); return output; } static bool AllowedWaterSurface(float pHeight, string pSurface, array<string> pAllowedSurfaceList) { if (pSurface) { pSurface.Replace("_ext", ""); pSurface.Replace("_int", ""); pSurface.Replace("sakhal_", ""); } bool isSeaCheck = false; foreach (string allowedSurface : pAllowedSurfaceList) { if (pSurface == "" && allowedSurface == UAWaterType.SEA) isSeaCheck = pHeight <= (g_Game.SurfaceGetSeaLevel() + 0.25); //MaxWave_default if (isSeaCheck || allowedSurface == pSurface) return true; } return false; } static bool CheckLiquidSource(float pHeight, string pSurface, int allowedWaterSourceMask) { bool success = false; if (pSurface == "") { if ( allowedWaterSourceMask & LIQUID_SALTWATER ) { success = pHeight <= (g_Game.SurfaceGetSeaLevel() + 0.25); //MaxWave_default } } else { int liquidType = SurfaceInfo.GetByName(pSurface).GetLiquidType(); success = allowedWaterSourceMask & liquidType; } return success; } }