Trinitycore: Core/Movement: Creatures casting channeled spells while moving instantly interrupts said spell

Created on 11 Dec 2017  路  24Comments  路  Source: TrinityCore/TrinityCore

Description:

When creatures start casting a channeled spell while moving, the spell is incorrectly interrupted when the creature stops moving, due to a movement update triggering a reevaluation of AURA_INTERRUPT_FLAG_MOVE.

Current behaviour:

  • Creature is chasing a player.
  • Creature starts casting a channeled spell.
  • Creature stops movement because that specific spell cannot be channeled while moving.
  • StopMove event triggers revaluation of the AURA_INTERRUPT_FLAG_MOVE, which in turn triggers the * creature to stop channeled spell.
  • Channeled spell is interrupted immediately.
  • Creature starts chasing the player again.

Expected behaviour:

  • Creature is chasing a player.
  • Creature starts casting a channeled spell.
  • Creature stops movement because that specific spell cannot be channeled while moving.
  • Creature finishes the channeled spell.
  • Creature starts chasing the player again.

Steps to reproduce the problem:

master branch:

  1. .gm on
  2. .go -14 -64 56.5 720
  3. Aggro a pack of Flame Archon's and kite them around until they starts casting one of their channeled spells.
  4. The channeled spells will immediately be interrupted after it starts being channeled.

3.3.5 branch:

  1. Go to Magtheridon (.go crea id 17257)
  2. Target some Hellfire Channeler
  3. Use .cast self 30207

Stack trace:
Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool withInstant) Line 2925
Unit::InterruptNonMeleeSpells(bool withDelayed, unsigned int spell_id, bool withInstant) Line 2988
Unit::RemoveAurasWithInterruptFlags(unsigned int flag, unsigned int except) Line 3911
Unit::UpdatePosition(float x, float y, float z, float orientation, bool teleport) Line 13036
Unit::UpdateSplinePosition() Line 547
Unit::StopMoving() Line 10325
TargetedMovementGeneratorMedium >::DoUpdate(Creature * owner, unsigned int time_diff) Line 156
MovementGeneratorMedium >::Update(Unit * u, unsigned int time_diff) Line 76.
MotionMaster::UpdateMotion(unsigned int diff) Line 93
Unit::Update(unsigned int p_time) Line 491
Creature::Update(unsigned int diff) Line 573

Branch(es):
master/335

TC rev. hash/commit:
0afec284903b24ee5f54178ff2274734cfc2814c

Branch-master Comp-Core Sub-Miscellaneous Sub-Spells

Most helpful comment

Just requires cherry pick from 3.3.5

All 24 comments

I think I've seen this issue in 3.3.5 too.

Added 3.3.5 to affected branches

maybe close the other tickets because generic bug?

I have to test my patch more.

Bit hackish but this may work:
https://gist.github.com/Langerz82/a3befa009bda4c57c3dc9240ecabaeae

Tip: add the short code snippet in your comment with ```diff on top of the snippet.

```diff --git src/server/game/Entities/Unit/Unit.cpp src/server/game/Entities/Unit/Unit.cpp
index 86df2a6d13..1720b49f32 100644
--- src/server/game/Entities/Unit/Unit.cpp
+++ src/server/game/Entities/Unit/Unit.cpp
@@ -10998,6 +10999,13 @@ void Unit::StopMoving()
if (!IsInWorld() || movespline->Finalized())
return;

  • if (!movespline->onTransport)
  • {
  • Position& pos = m_movementInfo.pos;
  • Relocate(pos);
  • SetOrientation(pos.GetOrientation());
  • }
    +
    // Update position now since Stop does not start a new movement that can be updated later
    UpdateSplinePosition();
    Movement::MoveSplineInit init(this);

Magtheridon case is not possible reproduce anymore.
Someone can test if Master case still is valid?

I will try to reproduce this on master when I can.

Still able to reproduce on 136269a5851a6755f644295a0171e4bc6c2bef17

Just requires cherry pick from 3.3.5

What commit fixed this on 3.3.5?

Probably ccrs movement rerwrite.

982643c then

Why did you close this exactly? Can't see a commit referencing this as fixed on master.

it's closed when the issue is fixed on one of the branches, it simply needs cp to the other branches.

Still not fixed in 3.3.5 (b283565d8adb394862ea2affd2af497bac6cdbcb)
Fixed Magtheridon Lair and Ruby Sanctum, but still happening with some creatures

Same issue happening in ICC right now
Suppressor's of Valithria is getting interrupt caused by UpdateSpline.
@ccrs any idea here? Last ariel/you fix do not work anymore (or not cover this case).

Reported Suppressors in https://github.com/TrinityCore/TrinityCore/issues/22908
Since cases reported in this issue is fixed already in 3.3.5

this is a master branch issue :)

It requires a cherry-pick or a different fix?

probably both 馃拑

Still the case in b0734f81bd2c on 3.3.5
.go c id 34196 and let creature cast Runed Flame Jets on you, when move

I added this script in https://github.com/TrinityCore/TrinityCore/issues/24909 and didn't noticed any problem while testing or I didn't pain attention to it. Maybe some recent changes broke it again

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tje3d picture tje3d  路  3Comments

Rushor picture Rushor  路  3Comments

Jildor picture Jildor  路  3Comments

Jonne733 picture Jonne733  路  3Comments

ZenoX92 picture ZenoX92  路  3Comments