diff options
author | jackpoz <giacomopoz@gmail.com> | 2015-09-05 22:45:15 +0200 |
---|---|---|
committer | Carbenium <carbenium@outlook.com> | 2015-09-24 23:58:26 +0200 |
commit | 7893ac6baf3407bcc7dc6d32215677699713e672 (patch) | |
tree | 25ef3e41f58920ae0abba218123d26f8d6d2eacd /src | |
parent | 5147c70c35fad4c2dba1ea7a23bd5a08b82b20ed (diff) |
Core/Spells: Fix crash happening when using items to cast spells
Fix a crash happening when using items casting spells like Item ID 37198
Fix #14900
(cherry picked from commit 166e66cc06d418b94e14abb30dea6a76ba9edce2)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 4118b39f303..a2f74202883 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -8162,9 +8162,6 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 } } - // use triggered flag only for items with many spell casts and for not first cast - uint8 count = 0; - // item spells cast at use for (uint8 i = 0; i < proto->Effects.size(); ++i) { @@ -8181,14 +8178,13 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 continue; } - Spell* spell = new Spell(this, spellInfo, (count > 0) ? TRIGGERED_FULL_MASK : TRIGGERED_NONE); + Spell* spell = new Spell(this, spellInfo, TRIGGERED_NONE); spell->m_CastItem = item; spell->m_cast_count = castCount; // set count of casts spell->m_misc.Raw.Data[0] = misc[0]; spell->m_misc.Raw.Data[1] = misc[1]; spell->prepare(&targets); - - ++count; + return; } // Item enchantments spells cast at use @@ -8210,14 +8206,13 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 continue; } - Spell* spell = new Spell(this, spellInfo, (count > 0) ? TRIGGERED_FULL_MASK : TRIGGERED_NONE); + Spell* spell = new Spell(this, spellInfo, TRIGGERED_NONE); spell->m_CastItem = item; spell->m_cast_count = castCount; // set count of casts spell->m_misc.Raw.Data[0] = misc[0]; spell->m_misc.Raw.Data[1] = misc[1]; spell->prepare(&targets); - - ++count; + return; } } } |