Core/Creature: Fixes Issue with Formations with 2 waypoints

By Malcrom
(cherry picked from commit 75842fb1a5fbae8fead8242656364580c33ead12)
This commit is contained in:
Aokromes
2015-09-25 00:19:34 +02:00
committed by Carbenium
parent ef5e3fff04
commit 78b1923da2
@@ -228,11 +228,13 @@ void CreatureGroup::LeaderMoveTo(float x, float y, float z)
if (itr->second->point_1)
{
if (m_leader->GetCurrentWaypointID() == itr->second->point_1 - 1)
itr->second->follow_angle = (2 * float(M_PI)) - itr->second->follow_angle;
if (m_leader->GetCurrentWaypointID() == itr->second->point_2 - 1)
itr->second->follow_angle = (float(M_PI)) + itr->second->follow_angle;
if (m_leader->GetCurrentWaypointID() == itr->second->point_1 - 1 || m_leader->GetCurrentWaypointID() == itr->second->point_2 - 1)
{
if (itr->second->follow_angle > float(M_PI))
itr->second->follow_angle = itr->second->follow_angle - float(M_PI);
else
itr->second->follow_angle = itr->second->follow_angle + float(M_PI);
}
}
float angle = itr->second->follow_angle;