* Fix for issue #71: division by zero on init resulted in bad value after

dev-ui
erihel 2013-04-26 16:51:17 +02:00
parent adb4b06550
commit 45f06cec51
1 changed files with 4 additions and 2 deletions

View File

@ -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 !