Allow players to track both herbs and minerals at the same time

Note: The following are client limitations and cannot be coded for:
      * The minimap tracking icon will display whichever skill is activated second
      * The minimap tracking list will only show a check mark next to the last skill activated (sometimes this
        bugs out and doesn't switch the check mark. It has no effect on the actual tracking though).
      * The minimap dots are yellow for both resources
This commit is contained in:
MrSmite committed 2014-09-05 15:06:05 -04:00
1 parent b20b6dedf9
commit 31c00b0ce4
5 files changed
+46

No files matched your search

+20
View File
@@ -33,6 +33,7 @@
#include "GameObjectAI.h"
#include "SpellAuraEffects.h"
#include "Player.h"
#include "Config.h"
void WorldSession::HandleClientCastFlags(WorldPacket& recvPacket, uint8 castFlags, SpellCastTargets& targets)
{
@@ -436,6 +437,25 @@ void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket)
// maybe should only remove one buff when there are multiple?
_player->RemoveOwnedAura(spellId, 0, 0, AURA_REMOVE_BY_CANCEL);
// If spell being removed is a resource tracker, see if player was tracking both (herbs / minerals) and remove the other
if (sWorld->getBoolConfig(CONFIG_ALLOW_TRACK_BOTH_RESOURCES) && spellInfo->HasAura(SPELL_AURA_TRACK_RESOURCES))
{
Unit::AuraEffectList const& auraEffects = _player->GetAuraEffectsByType(SPELL_AURA_TRACK_RESOURCES);
if (!auraEffects.empty())
{
// Build list of spell IDs to cancel. Trying to cancel the aura while iterating
// over AuraEffectList caused "incompatible iterator" errors on second pass
std::list<uint32> spellIDs;
for (Unit::AuraEffectList::const_iterator auraEffect = auraEffects.begin(); auraEffect != auraEffects.end(); auraEffect++)
spellIDs.push_back((*auraEffect)->GetId());
// Remove all auras related to resource tracking (only Herbs and Minerals in 3.3.5a)
for (std::list<uint32>::iterator it = spellIDs.begin(); it != spellIDs.end(); it++)
_player->RemoveOwnedAura(*it, 0, 0, AURA_REMOVE_BY_CANCEL);
}
}
}
void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket)