897 {
898 if (CfgGameplayHandler.GetDisableIsUnderwaterCheck())
899 return false;
900
901 string type;
902 int liquid;
904
906 {
907 #ifdef DIAG_DEVELOPER
908 DebugLog("IsUnderwater: ", false, true, " | Surface under object is water");
909 #endif
910 return true;
911 }
912
913
918 float maxSea =
g_Game.SurfaceGetSeaLevelMax() + 0.03;
919 bool belowMaxSea = left_close[1] < maxSea || right_close[1] < maxSea || left_far[1] < maxSea || right_far[1] < maxSea;
920
921 #ifdef DIAG_DEVELOPER
922
923 float lc =
g_Game.GetWaterDepth(left_close);
924 float rc =
g_Game.GetWaterDepth(right_close);
925 float lf =
g_Game.GetWaterDepth(left_far);
926 float rf =
g_Game.GetWaterDepth(right_far);
927 bool isTrue = (lc > 0 || rc > 0 || lf > 0 || rf > 0 || belowMaxSea);
928 DebugLog("IsUnderwater: ", false, isTrue, " belowMaxSea: " + belowMaxSea + " | (all must be less than zero) | lc: " + lc + " | rc: " + rc + " | lf: " + lf + " | rf: " + rf);
929
930 if (isTrue)
931 {
932 array<bool> conditions = {lc <= 0, rc <= 0, lf <= 0, rf <= 0};
933 DrawBaseSpheres(conditions);
934 }
935 #endif
936
937 return (belowMaxSea ||
g_Game.GetWaterDepth(left_close) > 0 ||
g_Game.GetWaterDepth(right_close) > 0 ||
g_Game.GetWaterDepth(left_far) > 0 ||
g_Game.GetWaterDepth(right_far) > 0);
938 }
vector GetLeftFarProjectionVector()
vector GetRightFarProjectionVector()
vector GetLeftCloseProjectionVector()
vector GetRightCloseProjectionVector()
const int LIQUID_GROUP_WATER