aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2020-02-23 22:07:40 +0100
committerShauren <shauren.trinity@gmail.com>2021-12-22 12:21:58 +0100
commita5b4d0c53976119d561924143a465c9ab38ca8a8 (patch)
tree658ef8e5bd8d889d8b6cb5c6f3f4a01dc3932251
parent865be2bdfacead73919ba68192e538c0e3a49d7e (diff)
Core/Movement: Add support to cyclic splines to GenericMovementGenerator
GenericMovementGenerator sets the _duration to the return value of spline.Launch(). For cyclic splines, this is the duration of 1 single cycle, while the spline itself never ends. To support this edge case in GenericMovementGenerator we just never update the _duration timer for cyclic splines. (cherry picked from commit 7a57029d8fd46c0966eb32b17019291785e61f37)
-rw-r--r--src/server/game/Movement/MovementGenerators/GenericMovementGenerator.cpp5
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp12
2 files changed, 4 insertions, 13 deletions
diff --git a/src/server/game/Movement/MovementGenerators/GenericMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/GenericMovementGenerator.cpp
index 94368304874..f8a494522c4 100644
--- a/src/server/game/Movement/MovementGenerators/GenericMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/GenericMovementGenerator.cpp
@@ -59,7 +59,10 @@ bool GenericMovementGenerator::Update(Unit* owner, uint32 diff)
if (!owner || HasFlag(MOVEMENTGENERATOR_FLAG_FINALIZED))
return false;
- _duration.Update(diff);
+ // Cyclic splines never expire, so update the duration only if it's not cyclic
+ if (!owner->movespline->isCyclic())
+ _duration.Update(diff);
+
if (_duration.Passed() || owner->movespline->Finalized())
{
AddFlag(MOVEMENTGENERATOR_FLAG_INFORM_ENABLED);
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
index 2422be16ec5..20ef0952791 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
@@ -1168,18 +1168,6 @@ class npc_ominous_cloud : public CreatureScript
me->GetMotionMaster()->MoveCirclePath(YoggSaronSpawnPos.GetPositionX(), YoggSaronSpawnPos.GetPositionY(), me->GetPositionZ() + 5.0f, me->GetDistance2d(YoggSaronSpawnPos.GetPositionX(), YoggSaronSpawnPos.GetPositionY()), clockwise, 16);
}
- void MovementInform(uint32 type, uint32 /*id*/) override
- {
- if (type != EFFECT_MOTION_TYPE)
- return;
-
- /* MoveCirclePath() add a GenericMovementGenerator that doesn't handle cyclic splines, handling only 1 round of the circle.
- * This means we have to reschedule another MoveCirclePath() every time the previous one ends.
- * Remove this code once GenericMovementGenerator properly handles cyclic splines.
- */
- me->GetMotionMaster()->MoveCirclePath(YoggSaronSpawnPos.GetPositionX(), YoggSaronSpawnPos.GetPositionY(), me->GetPositionZ() + 5.0f, me->GetDistance2d(YoggSaronSpawnPos.GetPositionX(), YoggSaronSpawnPos.GetPositionY()), clockwise, 16);
- }
-
bool clockwise = false;
};