Skip to content

Commit 133f869

Browse files
committed
Revert "Core/Entities: Fixed relative position calculation formula in Position::GetPositionOffsetTo"
This reverts commit 4a7fcfe.
1 parent 30131e8 commit 133f869

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/server/game/Entities/Object/Position.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ void Position::GetPositionOffsetTo(Position const& endPos, Position& retOffset)
5151
float dx = endPos.GetPositionX() - GetPositionX();
5252
float dy = endPos.GetPositionY() - GetPositionY();
5353

54-
retOffset.m_positionX = (dx + dy * std::tan(GetOrientation())) / (std::cos(GetOrientation()) + std::sin(GetOrientation()) * std::tan(GetOrientation()));
55-
retOffset.m_positionY = (dy - dx * std::tan(GetOrientation())) / (std::cos(GetOrientation()) + std::sin(GetOrientation()) * std::tan(GetOrientation()));
54+
retOffset.m_positionX = dx * std::cos(GetOrientation()) + dy * std::sin(GetOrientation());
55+
retOffset.m_positionY = dy * std::cos(GetOrientation()) - dx * std::sin(GetOrientation());
5656
retOffset.m_positionZ = endPos.GetPositionZ() - GetPositionZ();
5757
retOffset.SetOrientation(endPos.GetOrientation() - GetOrientation());
5858
}

0 commit comments

Comments
 (0)