diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 2a38a63d45..204d654d00 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1387,6 +1387,8 @@ float WorldObject::GetAngle( const float x, const float y ) const float dx = x - GetPositionX(); float dy = y - GetPositionY(); + if(!dx && !dy) + return 0; float ang = atan2(dy, dx); ang = (ang >= 0) ? ang : 2 * M_PI + ang; return ang;