From 7990867d43650fd21d953c4b30c3b67aae642872 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Fri, 25 Mar 2011 10:44:35 +0300 Subject: [PATCH] [11281] Code cleanup in Player::CastItemCombatSpell --- src/game/Player.cpp | 18 ++++++++++-------- src/shared/revision_nr.h | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index b1bec1635a1..a3e38ab7b09 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -7628,13 +7628,15 @@ void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType) if(!pEnchant) continue; for (int s = 0; s < 3; ++s) { - if (pEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) + uint32 proc_spell_id = pEnchant->spellid[s]; + + if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; - SpellEntry const *spellInfo = sSpellStore.LookupEntry(pEnchant->spellid[s]); + SpellEntry const *spellInfo = sSpellStore.LookupEntry(proc_spell_id); if (!spellInfo) { - sLog.outError("Player::CastItemCombatSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]); + sLog.outError("Player::CastItemCombatSpell Enchant %i, cast unknown spell %i", pEnchant->ID, proc_spell_id); continue; } @@ -7646,20 +7648,20 @@ void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType) : pEnchant->amount[s] != 0 ? float(pEnchant->amount[s]) : GetWeaponProcChance(); - ApplySpellMod(spellInfo->Id,SPELLMOD_CHANCE_OF_SUCCESS,chance); - ApplySpellMod(spellInfo->Id,SPELLMOD_FREQUENCY_OF_SUCCESS,chance); + ApplySpellMod(spellInfo->Id,SPELLMOD_CHANCE_OF_SUCCESS, chance); + ApplySpellMod(spellInfo->Id,SPELLMOD_FREQUENCY_OF_SUCCESS, chance); if (roll_chance_f(chance)) { - if(IsPositiveSpell(pEnchant->spellid[s])) - CastSpell(this, pEnchant->spellid[s], true, item); + if (IsPositiveSpell(spellInfo->Id)) + CastSpell(this, spellInfo->Id, true, item); else { // Deadly Poison, unique effect needs to be handled before casting triggered spell if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && spellInfo->SpellFamilyFlags & UI64LIT(0x10000)) _HandleDeadlyPoison(Target, attType, spellInfo); - CastSpell(Target, pEnchant->spellid[s], true, item); + CastSpell(Target, spellInfo->Id, true, item); } } } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 4d3851a8716..60ee549f693 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11280" + #define REVISION_NR "11281" #endif // __REVISION_NR_H__