Pre-calculate object validity once.
Fishing/synthetic/sea-normalized cursor path For fishing or other synthetic cursor actions, do not fall through to generic surface checks. If the synthetic cursor cannot be resolved, the action should not be available.
67 {
68 if (!target)
69 return false;
70
74
75 vector playerPos = player.GetPosition();
76 Object targetObj = target.GetObject();
77 vector objectPosition = vector.Zero;
78 bool isValidInteract = false;
79
81 if (targetObj)
82 {
85
86 if (targetObj.IsWell())
87 {
89 targetObj.GetActionComponentsForSelectionName(targetObj.GetViewGeometryLevel(), UAMisc.LIQUID_SOURCE_SELECTION, componentIndices);
90
91 if (componentIndices.Count() > 0)
92 isValidInteract = componentIndices.Find(target.GetComponentIndex()) != -1;
93 else
94 isValidInteract = true;
95 }
96 else
97 {
98 objectPosition = targetObj.GetPosition();
100 }
101 }
102
103 vector hitPosition = target.GetCursorHitPos();
104
105 #ifdef DIAG_DEVELOPER
106 m_DebugSyntheticCursor = DiagMenu.GetBool(
DiagMenuIDs.SYNTHETIC_FISHING_CURSOR);
107 #endif
108
112 {
113 vector resolvedHitPosition;
114 int resolvedLiquidType;
115
117 {
118 hitPosition = resolvedHitPosition;
119 target.SetCursorHitPos(hitPosition);
120
123 }
124 }
125
126 if (isValidInteract && targetObj)
127 {
130 }
131
132 string surfaceType;
133 if (
CheckSurfaceLiquid(player, targetObj, hitPosition, playerPos, isValidInteract, surfaceType))
134 {
136 }
137
139 {
141 {
142 #ifdef DIAG_DEVELOPER
143 DbgUI.Begin("", 10, 200);
144 if (m_DebugSyntheticCursor)
145 {
146 DbgUI.Text(string.Format("CCTLiquid CheckSeaLevelFallback rejected: reason=could not create sea hit point | hitPosition=%1 | playerPos=%2", hitPosition, playerPos));
147 }
148 DbgUI.End();
149 #endif
150 }
151 }
152
154 }
bool TryResolveSyntheticCursor(PlayerBase player, vector playerPos, vector currentHitPosition, out vector resolvedHitPosition, out int resolvedLiquidType)
bool IsValidTargetObject(vector playerPos, vector objectPosition, EWaterSourceObjectType waterSourceType, ELiquidSourceObjectType liquidSourceType, bool isProxy)
bool CheckSeaLevelFallback(vector hitPosition, vector playerPos)
bool IsValidLiquid(int liquid)
bool m_AllowSeaLevelCursorFallback
bool CheckSurfaceLiquid(PlayerBase player, Object targetObj, vector hitPosition, vector playerPos, bool isValidInteract, out string surfaceType)