diff options
author | Shauren <shauren.trinity@gmail.com> | 2018-02-04 00:11:10 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2018-02-18 16:33:27 +0100 |
commit | c9465979c6002ae43bb8e536e3ad0f6d1be36b98 (patch) | |
tree | 14b8e3b7e728659e4aceea529f74a3a5b904bc24 /src/server/game/Handlers/SpellHandler.cpp | |
parent | c0abcc838be68f340f8276e6ba2c430276779b5b (diff) |
Core/Entities: Update updatefields to 7.3.5.25928
Diffstat (limited to 'src/server/game/Handlers/SpellHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/SpellHandler.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index d3e8db0004a..ca011dfd61f 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -461,19 +461,20 @@ void WorldSession::HandleTotemDestroyed(WorldPackets::Totem::TotemDestroyed& tot totem->ToTotem()->UnSummon(); } -void WorldSession::HandleSelfResOpcode(WorldPackets::Spells::SelfRes& /*packet*/) +void WorldSession::HandleSelfResOpcode(WorldPackets::Spells::SelfRes& selfRes) { if (_player->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION)) return; // silent return, client should display error by itself and not send this opcode - if (_player->GetUInt32Value(PLAYER_SELF_RES_SPELL)) - { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(_player->GetUInt32Value(PLAYER_SELF_RES_SPELL)); - if (spellInfo) - _player->CastSpell(_player, spellInfo, false, nullptr); + std::vector<uint32> const& selfResSpells = _player->GetDynamicValues(PLAYER_DYNAMIC_FIELD_SELF_RES_SPELLS); + if (std::find(selfResSpells.begin(), selfResSpells.end(), selfRes.SpellID) == selfResSpells.end()) + return; - _player->SetUInt32Value(PLAYER_SELF_RES_SPELL, 0); - } + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(selfRes.SpellID); + if (spellInfo) + _player->CastSpell(_player, spellInfo, false, nullptr); + + _player->RemoveDynamicValue(PLAYER_DYNAMIC_FIELD_SELF_RES_SPELLS, selfRes.SpellID); } void WorldSession::HandleSpellClick(WorldPackets::Spells::SpellClick& spellClick) |