Page MenuHomeFeedback Tracker

CCTWaterSurface doesn't measure distance to target correctly
Assigned, NormalPublic

Description

The Target Conditions Component CCTWaterSurface calculates the distance between the player and the action target point incorrectly. It uses the GetGame().SurfaceY function to 'fix' the Y coordinate of the cursor position target, which actually returns the Y coordinate of the terrain under the water rather then the water surface. This manifests in fishing and other water interactions only being valid when close to to the shore where the water is shallow. This can be corrected by adding the depth of the water at the target point to the Y coordinate returned by SurfaceY:

//Need to adjust for the depth as SurfaceY gives the coordinates of the bottom not the surface of the water
float water_depth = g_Game.GetWaterDepth(hit_pos);
hit_pos[1] = hit_pos[1] + water_depth;

Details

Severity
Major
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Scripting
Steps To Reproduce

Try to fish in any deeper water, the action prompt will not appear.

Event Timeline

RedFalcon created this task.Jan 3 2023, 6:34 AM
Geez changed the task status from New to Assigned.Jan 4 2023, 12:07 PM

This looks to have been resolved in 1.20

lava76 added a subscriber: lava76.Jan 25 2023, 6:45 PM