We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 30131e8 commit 133f869Copy full SHA for 133f869
1 file changed
src/server/game/Entities/Object/Position.cpp
@@ -51,8 +51,8 @@ void Position::GetPositionOffsetTo(Position const& endPos, Position& retOffset)
51
float dx = endPos.GetPositionX() - GetPositionX();
52
float dy = endPos.GetPositionY() - GetPositionY();
53
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()));
+ retOffset.m_positionX = dx * std::cos(GetOrientation()) + dy * std::sin(GetOrientation());
+ retOffset.m_positionY = dy * std::cos(GetOrientation()) - dx * std::sin(GetOrientation());
56
retOffset.m_positionZ = endPos.GetPositionZ() - GetPositionZ();
57
retOffset.SetOrientation(endPos.GetOrientation() - GetOrientation());
58
}
0 commit comments