* Fix for issue #71: division by zero on init resulted in bad value after
parent
adb4b06550
commit
45f06cec51
|
@ -90,8 +90,10 @@ bool CTaskGoto::EventProcess(const Event &event)
|
|||
rot.x = m_leakPos.x-pos.x;
|
||||
rot.y = m_leakPos.z-pos.z;
|
||||
dist = Math::Point(rot.x, rot.y).Length();
|
||||
rot.x /= dist;
|
||||
rot.y /= dist;
|
||||
if (dist != 0) {
|
||||
rot.x /= dist;
|
||||
rot.y /= dist;
|
||||
}
|
||||
|
||||
a = m_object->GetAngleY(0);
|
||||
g = Math::RotateAngle(rot.x, -rot.y); // CW !
|
||||
|
|
Loading…
Reference in New Issue