Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion source/D2Common/src/Path/PathUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ void __fastcall sub_6FDAB940(D2PathPointStrc* pOutPathPoint, D2DynamicPathStrc*

if (ptPath->dwSpeed)
{
PATHUtil_AdvanceTowardsTarget_6FDAB890(ptPath);
// Same lead as PATHUtil_AdvanceTowardsTarget_6FDAB890, but applied to the returned point instead of the path's target
const uint8_t nDirection = PATH_GetDirection(pTargetUnit->pDynamicPath);
const int nSpeed = ptPath->dwSpeed;
uint16_t v4 = (uint16_t)nSpeed << 8;
const float nDistance = nSpeed;
const uint16_t nAngleRad512 = (8 * nDirection - v4) & 0x1FF;
pOutPathPoint->X += (int64_t)(FOG_10083_Cos_LUT(nAngleRad512) * nDistance);
pOutPathPoint->Y += (int64_t)(FOG_10084_Sin_LUT(nAngleRad512) * nDistance);
}
}
Loading