Skip to content

Commit

Permalink
Fix Combustion exploit
Browse files Browse the repository at this point in the history
  • Loading branch information
Warlockbugs committed Sep 28, 2016
1 parent 09fa3a8 commit f7b84f3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/game/Player.cpp
Expand Up @@ -3426,7 +3426,8 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank, bo
playerSpell.state = PLAYERSPELL_REMOVED;
}

RemoveAurasDueToSpell(spell_id);
RemoveAurasByCasterSpell(spell_id, GetObjectGuid());
RemoveAurasTriggeredBySpell(spell_id, GetObjectGuid());

// remove pet auras
for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
Expand Down
19 changes: 19 additions & 0 deletions src/game/Unit.cpp
Expand Up @@ -4686,6 +4686,25 @@ void Unit::RemoveAurasDueToSpellByCancel(uint32 spellId)
}
}

void Unit::RemoveAurasTriggeredBySpell(uint32 spellId, ObjectGuid casterGuid /*= ObjectGuid()*/)
{
if (!spellId)
return;

SpellAuraHolderMap& auras = GetSpellAuraHolderMap();
for (SpellAuraHolderMap::iterator itr = auras.begin(); itr != auras.end();)
{
const SpellEntry* entry = itr->second->GetTriggeredBy();
if ((entry && entry->Id == spellId) && (casterGuid.IsEmpty() || casterGuid == itr->second->GetCasterGuid()))
{
RemoveSpellAuraHolder(itr->second);
itr = auras.begin();
}
else
++itr;
}
}

void Unit::RemoveAurasWithDispelType(DispelType type, ObjectGuid casterGuid)
{
// Create dispel mask by dispel type
Expand Down
1 change: 1 addition & 0 deletions src/game/Unit.h
Expand Up @@ -1733,6 +1733,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
void RemoveAurasByCasterSpell(uint32 spellId, ObjectGuid casterGuid);
void RemoveAurasDueToSpellBySteal(uint32 spellId, ObjectGuid casterGuid, Unit* stealer);
void RemoveAurasDueToSpellByCancel(uint32 spellId);
void RemoveAurasTriggeredBySpell(uint32 spellId, ObjectGuid casterGuid = ObjectGuid());

// removing unknown aura stacks by diff reasons and selections
void RemoveNotOwnTrackedTargetAuras(uint32 newPhase = 0x0);
Expand Down

0 comments on commit f7b84f3

Please sign in to comment.