Skip to content

Commit

Permalink
Core/AI: Fix reset and interruption of non melee spells
Browse files Browse the repository at this point in the history
  • Loading branch information
Killyana committed Mar 22, 2020
1 parent b166d12 commit cc0c56c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/server/game/AI/CreatureAI.cpp
Expand Up @@ -205,6 +205,11 @@ void CreatureAI::JustAppeared()
}
}

void CreatureAI::JustReachedHome()
{
Reset();
}

void CreatureAI::JustEnteredCombat(Unit* who)
{
if (!IsEngaged() && !me->CanHaveThreatList())
Expand Down Expand Up @@ -234,7 +239,6 @@ void CreatureAI::EnterEvadeMode(EvadeReason why)
}
}

Reset();
}

bool CreatureAI::UpdateVictim()
Expand Down Expand Up @@ -276,6 +280,7 @@ void CreatureAI::EngagementStart(Unit* who)
}
_isEngaged = true;

me->InterruptNonMeleeSpells(false);
me->AtEngage(who);
}

Expand Down
2 changes: 1 addition & 1 deletion src/server/game/AI/CreatureAI.h
Expand Up @@ -157,7 +157,7 @@ class TC_GAME_API CreatureAI : public UnitAI
void OnCharmed(bool isNew) override;

// Called at reaching home after evade
virtual void JustReachedHome() { }
virtual void JustReachedHome();

void DoZoneInCombat(Creature* creature = nullptr);

Expand Down

8 comments on commit cc0c56c

@jackpoz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this come from somewhere or ?

@Killyana
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It get pushed accidentally with an other commit?
#24345

@jackpoz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we revert this if it was merged by accident then ?

@Jildor
Copy link
Contributor

@Jildor Jildor commented on cc0c56c Mar 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if was merged by accident and not is sure if should be merged or not, maybe is better revert and make the PR again.

@Killyana
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked many scripts, and I didn't found any case where this change cause an issue. The reset must happen in JustReachedHome and not evade anyway.
Same for InterruptNonMeleeSpells is the default behavior, and I cannot find any creature that must continue channeling after being aggro, if we have a such case it must be fixed in the script and not done by the native AI.

@d0d0
Copy link
Contributor

@d0d0 d0d0 commented on cc0c56c Mar 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I found. Try Sindragosa in ICC - allow all players to get inside Ice Block. After "wipe" she will run to place, all players are in blocks and will not be properly reseted. On the next pull she will start in phase 3 (depends how quick you are) and also enrage comes quickier due no reset

@Killyana
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes for this reasons we revert it

@d0d0
Copy link
Contributor

@d0d0 d0d0 commented on cc0c56c Apr 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, I missed revert

Please sign in to comment.