Core/InstanceScript: Function DoRemoveAurasDoToSpellOnPlayers() will also remove those auras from players' pets

This commit is contained in:
Lopin
2011-08-19 18:17:04 +02:00
parent 9cfe17cf21
commit d2f2c4dee5
+11 -4
View File
@@ -356,11 +356,18 @@ void InstanceScript::DoStopTimedAchievement(AchievementCriteriaTimedTypes type,
void InstanceScript::DoRemoveAurasDueToSpellOnPlayers(uint32 spell) void InstanceScript::DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
{ {
Map::PlayerList const& PlayerList = instance->GetPlayers(); Map::PlayerList const& PlayerList = instance->GetPlayers();
if (!PlayerList.isEmpty()) if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) {
if (Player* pPlayer = i->getSource()) for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
pPlayer->RemoveAurasDueToSpell(spell); {
if (Player* player = itr->getSource())
{
player->RemoveAurasDueToSpell(spell);
if (Pet* pet = player->GetPet())
pet->RemoveAurasDueToSpell(spell);
}
}
}
} }
// Cast spell on all players in instance // Cast spell on all players in instance