diff options
| author | Aokromes <Aokromes@users.noreply.github.com> | 2015-09-22 18:29:22 +0200 |
|---|---|---|
| committer | Aokromes <Aokromes@users.noreply.github.com> | 2015-09-22 18:29:22 +0200 |
| commit | 75842fb1a5fbae8fead8242656364580c33ead12 (patch) | |
| tree | 64fb54152d052f5f338476f4eb3f052ba1ed3c7c | |
| parent | 7af320c4194cdacc8f193b6bfd54681d86d582d0 (diff) | |
Core/Creature: Fixes Issue with Formations with 2 waypoints
By Malcrom
| -rw-r--r-- | src/server/game/Entities/Creature/CreatureGroups.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index 505d41f63e7..9d0149a24a5 100644 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -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; |
