20 if (!target || (target && target.GetObject()))
24 vector hitPosition = target.GetCursorHitPos();
27 float waterLevel = player.GetCurrentWaterLevel();
28 g_Game.SurfaceGetType3D(hitPosition[0], hitPosition[1] + waterLevel, hitPosition[2], surfaceType);
33 float surfaceHeight =
g_Game.SurfaceY(hitPosition[0], hitPosition[2]);
37 surfaceHeight = hitPosition[1];
40 float heightDiff =
Math.
AbsFloat(hitPosition[1] - surfaceHeight);
74 vector hitPosition = target.GetCursorHitPos();
80 string surfaceName = target.GetSurfaceName();
87 if (surfaceName ==
"" && hitPos !=
vector.
Zero)
90 bool isSea =
g_Game.SurfaceIsSea(hitPos[0], hitPos[2]);
93 success = hitPos[1] <= (
g_Game.SurfaceGetSeaLevel() + 0.25);
98 success = allowedWaterSourceMask & liquidType;
115 Object targetObject = target.GetObject();
int GetSurfaceLiquidType()
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
int m_AllowedLiquidSource
void CCTWaterSurfaceEx(float maximal_target_distance, int allowedLiquidSource)
bool CheckLiquidSource(vector hitPos, string surfaceName, int liquidType, int allowedWaterSourceMask)
CCTWaterSurface m_MaximalActionDistanceSq
bool CanContinue(PlayerBase player, ActionTarget target)
bool Can(PlayerBase player, ActionTarget target)
float m_MaximalActionDistanceSq
override bool CanContinue(PlayerBase player, ActionTarget target)
override bool Can(PlayerBase player, ActionTarget target)
void CCTWaterSurface(float maximal_target_distance=UAMaxDistances.DEFAULT, string surfaceType="")
const int HEIGHT_DIFF_LIMIT_METERS
ref array< string > m_AllowedSurfaceList
DEPRECATED.
static bool AllowedWaterSurface(float pHeight, string pSurface, array< string > pAllowedSurfaceList)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
const int LIQUID_SALTWATER
static proto float AbsFloat(float f)
Returns absolute value.