aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGiacomo Pozzoni <giacomopoz@gmail.com>2019-05-28 16:05:22 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-08 23:35:01 +0100
commit6e28ecd22ea5ba8a7a2d0b08217aa68010b1cfc4 (patch)
tree8da9a92f7d60b01cdca13ce88f569118bf68c3bd /src
parentf45befd60706a84583574ae3142a8cf86ed8a458 (diff)
Core/Movement: Fix assertion triggered in SplineChainMovementGenerator
Fix an assertion triggered in SplineChainMovementGenerator happening when a new generator is added while last spline of the SplineChainMovementGenerator is being processed but is not finalized yet. Fix #23077 (cherry picked from commit 5d7f0eef6e2f89d5dbeb0a702f7a35c95626240e)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Movement/MovementGenerators/SplineChainMovementGenerator.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server/game/Movement/MovementGenerators/SplineChainMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/SplineChainMovementGenerator.cpp
index aad994a8c70..c3eed855aee 100644
--- a/src/server/game/Movement/MovementGenerators/SplineChainMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/SplineChainMovementGenerator.cpp
@@ -89,6 +89,13 @@ void SplineChainMovementGenerator::Initialize(Unit* owner)
return;
}
+ if (_nextIndex >= _chainSize)
+ {
+ TC_LOG_WARN("movement", "SplineChainMovementGenerator::Initialize: couldn't initialize generator, _nextIndex is >= _chainSize (%s)", owner->GetGUID().ToString().c_str());
+ _msToNext = 0;
+ return;
+ }
+
if (_nextFirstWP) // this is a resumed movegen that has to start with a partial spline
{
if (HasFlag(MOVEMENTGENERATOR_FLAG_FINALIZED))