Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.3.5][6.x]Core/Unit: Do not remove auras from Pets and Guardians after evading #16503

Merged
merged 1 commit into from Apr 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/server/game/AI/CreatureAI.cpp
Expand Up @@ -257,9 +257,7 @@ bool CreatureAI::_EnterEvadeMode(EvadeReason /*why*/)
if (!me->IsAlive())
return false;

// don't remove vehicle auras, passengers aren't supposed to drop off the vehicle
// don't remove clone caster on evade (to be verified)
me->RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE, SPELL_AURA_CLONE_CASTER);
me->RemoveAurasOnEvade();

// sometimes bosses stuck in combat?
me->DeleteThreatList();
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/AI/SmartScripts/SmartAI.cpp
Expand Up @@ -413,7 +413,7 @@ void SmartAI::EnterEvadeMode(EvadeReason /*why*/)
if (!me->IsAlive() || me->IsInEvadeMode())
return;

me->RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE, SPELL_AURA_CLONE_CASTER);
me->RemoveAurasOnEvade();

me->AddUnitState(UNIT_STATE_EVADE);
me->DeleteThreatList();
Expand Down
10 changes: 10 additions & 0 deletions src/server/game/Entities/Unit/Unit.cpp
Expand Up @@ -4113,6 +4113,16 @@ void Unit::RemoveArenaAuras()
}
}

void Unit::RemoveAurasOnEvade()
{
if (IsCharmedOwnedByPlayerOrPlayer()) // if it is a player owned creature it should not remove the aura
Copy link
Contributor Author

Choose a reason for hiding this comment

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

any news on this? would you like to improve sth. here?

Copy link

Choose a reason for hiding this comment

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

Looks good to me™. I am fairly sure @ccrs meant it should look like this.

return;

// don't remove vehicle auras, passengers aren't supposed to drop off the vehicle
// don't remove clone caster on evade (to be verified)
RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE, SPELL_AURA_CLONE_CASTER);
}

void Unit::RemoveAllAurasOnDeath()
{
// used just after dieing to remove all visible auras
Expand Down
1 change: 1 addition & 0 deletions src/server/game/Entities/Unit/Unit.h
Expand Up @@ -1720,6 +1720,7 @@ class Unit : public WorldObject
void RemoveAreaAurasDueToLeaveWorld();
void RemoveAllAuras();
void RemoveArenaAuras();
void RemoveAurasOnEvade();
void RemoveAllAurasOnDeath();
void RemoveAllAurasRequiringDeadTarget();
void RemoveAllAurasExceptType(AuraType type);
Expand Down