Skip to content
This repository
Browse code

[mr2107] remove unused variable in ApplySpellMod

  • Loading branch information...
commit ba877fd82e81b93aed634351cb40449f4156800b 1 parent 2d5578c
Philipp Dallig Reamer authored
20 src/game/Player.cpp
@@ -19894,7 +19894,7 @@ void Player::AddSpellMod(Aura* aura, bool apply)
19894 19894 m_spellMods[mod->m_miscvalue].remove(aura);
19895 19895 }
19896 19896
19897   -template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell const* spell)
  19897 +template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue)
19898 19898 {
19899 19899 SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
19900 19900 if (!spellInfo)
@@ -19933,9 +19933,9 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
19933 19933 return T(diff);
19934 19934 }
19935 19935
19936   -template int32 Player::ApplySpellMod<int32>(uint32 spellId, SpellModOp op, int32 &basevalue, Spell const* spell);
19937   -template uint32 Player::ApplySpellMod<uint32>(uint32 spellId, SpellModOp op, uint32 &basevalue, Spell const* spell);
19938   -template float Player::ApplySpellMod<float>(uint32 spellId, SpellModOp op, float &basevalue, Spell const* spell);
  19936 +template int32 Player::ApplySpellMod<int32>(uint32 spellId, SpellModOp op, int32 &basevalue);
  19937 +template uint32 Player::ApplySpellMod<uint32>(uint32 spellId, SpellModOp op, uint32 &basevalue);
  19938 +template float Player::ApplySpellMod<float>(uint32 spellId, SpellModOp op, float &basevalue);
19939 19939
19940 19940 // send Proficiency
19941 19941 void Player::SendProficiency(ItemClass itemClass, uint32 itemSubclassMask)
@@ -20777,7 +20777,7 @@ void Player::UpdatePvP(bool state, bool ovrride)
20777 20777 }
20778 20778 }
20779 20779
20780   -void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, Spell* spell, bool infinityCooldown)
  20780 +void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, bool infinityCooldown)
20781 20781 {
20782 20782 // init cooldown values
20783 20783 uint32 cat = 0;
@@ -20835,10 +20835,10 @@ void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 it
20835 20835
20836 20836 // Now we have cooldown data (if found any), time to apply mods
20837 20837 if (rec > 0)
20838   - ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, rec, spell);
  20838 + ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, rec);
20839 20839
20840 20840 if (catrec > 0)
20841   - ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, catrec, spell);
  20841 + ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, catrec);
20842 20842
20843 20843 // replace negative cooldowns by 0
20844 20844 if (rec < 0) rec = 0;
@@ -20882,10 +20882,10 @@ void Player::AddSpellCooldown(uint32 spellid, uint32 itemid, time_t end_time)
20882 20882 m_spellCooldowns[spellid] = sc;
20883 20883 }
20884 20884
20885   -void Player::SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId, Spell* spell)
  20885 +void Player::SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId)
20886 20886 {
20887 20887 // start cooldowns at server side, if any
20888   - AddSpellAndCategoryCooldowns(spellInfo, itemId, spell);
  20888 + AddSpellAndCategoryCooldowns(spellInfo, itemId);
20889 20889
20890 20890 // Send activate cooldown timer (possible 0) at client side
20891 20891 WorldPacket data(SMSG_COOLDOWN_EVENT, (4+8));
@@ -20912,7 +20912,7 @@ void Player::UpdatePotionCooldown(Spell* spell)
20912 20912 }
20913 20913 // from spell cases (m_lastPotionId set in Spell::SendSpellCooldown)
20914 20914 else
20915   - SendCooldownEvent(spell->m_spellInfo,m_lastPotionId,spell);
  20915 + SendCooldownEvent(spell->m_spellInfo,m_lastPotionId);
20916 20916
20917 20917 m_lastPotionId = 0;
20918 20918 }
6 src/game/Player.h
@@ -1698,7 +1698,7 @@ class MANGOS_DLL_SPEC Player : public Unit
1698 1698 SpellEntry const* GetKnownTalentRankById(int32 talentId) const;
1699 1699
1700 1700 void AddSpellMod(Aura* aura, bool apply);
1701   - template <class T> T ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell const* spell = NULL);
  1701 + template <class T> T ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue);
1702 1702
1703 1703 static uint32 const infinityCooldownDelay = MONTH; // used for set "infinity cooldowns" for spells and check
1704 1704 static uint32 const infinityCooldownDelayCheck = MONTH/2;
@@ -1713,9 +1713,9 @@ class MANGOS_DLL_SPEC Player : public Unit
1713 1713 time_t t = time(NULL);
1714 1714 return itr != m_spellCooldowns.end() && itr->second.end > t ? itr->second.end - t : 0;
1715 1715 }
1716   - void AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, Spell* spell = NULL, bool infinityCooldown = false );
  1716 + void AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, bool infinityCooldown = false );
1717 1717 void AddSpellCooldown(uint32 spell_id, uint32 itemid, time_t end_time);
1718   - void SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId = 0, Spell* spell = NULL);
  1718 + void SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId = 0);
1719 1719 void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs );
1720 1720 void RemoveSpellCooldown(uint32 spell_id, bool update = false);
1721 1721 void RemoveSpellCategoryCooldown(uint32 cat, bool update = false);
30 src/game/Spell.cpp
@@ -1326,7 +1326,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
1326 1326 // Apply multiplier mods
1327 1327 if (real_caster)
1328 1328 if (Player* modOwner = real_caster->GetSpellModOwner())
1329   - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_EFFECT_PAST_FIRST, multiplier, this);
  1329 + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_EFFECT_PAST_FIRST, multiplier);
1330 1330 m_damageMultipliers[effectNumber] *= multiplier;
1331 1331 }
1332 1332
@@ -1622,7 +1622,7 @@ void Spell::HandleDelayedSpellLaunch(TargetInfo *target)
1622 1622 // Apply multiplier mods
1623 1623 if (real_caster)
1624 1624 if (Player* modOwner = real_caster->GetSpellModOwner())
1625   - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_EFFECT_PAST_FIRST, multiplier, this);
  1625 + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_EFFECT_PAST_FIRST, multiplier);
1626 1626 m_damageMultipliers[effectNumber] *= multiplier;
1627 1627 }
1628 1628 }
@@ -1642,7 +1642,7 @@ void Spell::InitializeDamageMultipliers()
1642 1642 uint32 EffectChainTarget = m_spellInfo->EffectChainTarget[i];
1643 1643 if (Unit* realCaster = GetAffectiveCaster())
1644 1644 if (Player* modOwner = realCaster->GetSpellModOwner())
1645   - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, EffectChainTarget, this);
  1645 + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, EffectChainTarget);
1646 1646
1647 1647 m_damageMultipliers[i] = 1.0f;
1648 1648 if ( (m_spellInfo->EffectImplicitTargetA[i] == TARGET_CHAIN_DAMAGE || m_spellInfo->EffectImplicitTargetA[i] == TARGET_CHAIN_HEAL) &&
@@ -1757,8 +1757,8 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
1757 1757 {
1758 1758 if (Player* modOwner = realCaster->GetSpellModOwner())
1759 1759 {
1760   - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius, this);
1761   - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, EffectChainTarget, this);
  1760 + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius);
  1761 + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, EffectChainTarget);
1762 1762 }
1763 1763 }
1764 1764
@@ -2082,7 +2082,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
2082 2082
2083 2083 //Glyph of blink or etc this type
2084 2084 if (m_caster->GetTypeId() == TYPEID_PLAYER)
2085   - ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, distance, this);
  2085 + ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, distance);
2086 2086
2087 2087 float fx = target->GetPositionX() + distance * cos(direction);
2088 2088 float fy = target->GetPositionY() + distance * sin(direction);
@@ -4138,7 +4138,7 @@ void Spell::SendSpellCooldown()
4138 4138 if (m_spellInfo->HasAttribute(SPELL_ATTR_DISABLED_WHILE_ACTIVE) || m_spellInfo->HasAttribute(SPELL_ATTR_PASSIVE))
4139 4139 return;
4140 4140
4141   - _player->AddSpellAndCategoryCooldowns(m_spellInfo, m_CastItem ? m_CastItem->GetEntry() : 0, this);
  4141 + _player->AddSpellAndCategoryCooldowns(m_spellInfo, m_CastItem ? m_CastItem->GetEntry() : 0);
4142 4142 }
4143 4143
4144 4144 void Spell::update(uint32 difftime)
@@ -5120,7 +5120,7 @@ void Spell::TakePower()
5120 5120
5121 5121 if (needApplyMod)
5122 5122 if (Player* modOwner = m_caster->GetSpellModOwner())
5123   - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST_ON_HIT_FAIL, m_powerCost, this);
  5123 + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST_ON_HIT_FAIL, m_powerCost);
5124 5124
5125 5125 m_caster->ModifyPower(powerType, -(int32)m_powerCost);
5126 5126
@@ -5161,7 +5161,7 @@ SpellCastResult Spell::CheckOrTakeRunePower(bool take)
5161 5161 // at this moment for rune cost exist only no cost mods, and no percent mods
5162 5162 int32 runeCostMod = 10000;
5163 5163 if (Player* modOwner = plr->GetSpellModOwner())
5164   - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, runeCostMod, this);
  5164 + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, runeCostMod);
5165 5165
5166 5166 if (runeCostMod > 0)
5167 5167 {
@@ -7066,7 +7066,7 @@ SpellCastResult Spell::CheckRange(bool strict, WorldObject* checkTarget)
7066 7066 float range_mod = combat_range + add_range;
7067 7067
7068 7068 if (Player* modOwner = m_caster->GetSpellModOwner())
7069   - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range_mod, this);
  7069 + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range_mod);
7070 7070
7071 7071 float range_delta = range_mod - combat_range;
7072 7072
@@ -7082,7 +7082,7 @@ SpellCastResult Spell::CheckRange(bool strict, WorldObject* checkTarget)
7082 7082 }
7083 7083
7084 7084 if (Player* modOwner = m_caster->GetSpellModOwner())
7085   - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, max_range, this);
  7085 + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, max_range);
7086 7086
7087 7087 if (target && target != m_caster)
7088 7088 {
@@ -7181,7 +7181,7 @@ int32 Spell::CalculatePowerCost(SpellEntry const* spellInfo, Unit* caster, Spell
7181 7181 // Apply cost mod by spell
7182 7182 if (spell)
7183 7183 if (Player* modOwner = caster->GetSpellModOwner())
7184   - modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_COST, powerCost, spell);
  7184 + modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_COST, powerCost);
7185 7185
7186 7186 if (spellInfo->HasAttribute(SPELL_ATTR_LEVEL_DAMAGE_CALCULATION))
7187 7187 powerCost = int32(powerCost/ (1.117f * spellInfo->spellLevel / caster->getLevel() -0.1327f));
@@ -7723,7 +7723,7 @@ void Spell::Delayed()
7723 7723 // check pushback reduce
7724 7724 int32 delaytime = 500; // spellcasting delay is normally 500ms
7725 7725 int32 delayReduce = 100; // must be initialized to 100 for percent modifiers
7726   - ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_NOT_LOSE_CASTING_TIME, delayReduce, this);
  7726 + ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_NOT_LOSE_CASTING_TIME, delayReduce);
7727 7727 delayReduce += m_caster->GetTotalAuraModifier(SPELL_AURA_REDUCE_PUSHBACK) - 100;
7728 7728 if (delayReduce >= 100)
7729 7729 return;
@@ -7758,7 +7758,7 @@ void Spell::DelayedChannel()
7758 7758 // check pushback reduce
7759 7759 int32 delaytime = GetSpellDuration(m_spellInfo) * 25 / 100;// channeling delay is normally 25% of its time per hit
7760 7760 int32 delayReduce = 100; // must be initialized to 100 for percent modifiers
7761   - ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_NOT_LOSE_CASTING_TIME, delayReduce, this);
  7761 + ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_NOT_LOSE_CASTING_TIME, delayReduce);
7762 7762 delayReduce += m_caster->GetTotalAuraModifier(SPELL_AURA_REDUCE_PUSHBACK) - 100;
7763 7763 if (delayReduce >= 100)
7764 7764 return;
@@ -8425,7 +8425,7 @@ void Spell::TriggerGlobalCooldown()
8425 8425 {
8426 8426 // gcd modifier auras applied only to self spells and only player have mods for this
8427 8427 if (m_caster->GetTypeId() == TYPEID_PLAYER)
8428   - ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_GLOBAL_COOLDOWN, gcd, this);
  8428 + ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_GLOBAL_COOLDOWN, gcd);
8429 8429
8430 8430 // apply haste rating
8431 8431 gcd = int32(float(gcd) * m_caster->GetFloatValue(UNIT_MOD_CAST_SPEED));
4 src/game/SpellAuras.cpp
@@ -10630,7 +10630,7 @@ void SpellAuraHolder::_AddSpellAuraHolder()
10630 10630 if (m_spellProto->HasAttribute(SPELL_ATTR_DISABLED_WHILE_ACTIVE))
10631 10631 {
10632 10632 Item* castItem = m_castItemGuid ? ((Player*)caster)->GetItemByGuid(m_castItemGuid) : NULL;
10633   - ((Player*)caster)->AddSpellAndCategoryCooldowns(m_spellProto,castItem ? castItem->GetEntry() : 0, NULL,true);
  10633 + ((Player*)caster)->AddSpellAndCategoryCooldowns(m_spellProto,castItem ? castItem->GetEntry() : 0,true);
10634 10634 }
10635 10635 }
10636 10636
@@ -12371,7 +12371,7 @@ void SpellAuraHolder::Update(uint32 diff)
12371 12371 float max_range = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellProto->rangeIndex));
12372 12372
12373 12373 if(Player* modOwner = caster->GetSpellModOwner())
12374   - modOwner->ApplySpellMod(GetId(), SPELLMOD_RANGE, max_range, NULL);
  12374 + modOwner->ApplySpellMod(GetId(), SPELLMOD_RANGE, max_range);
12375 12375
12376 12376 if(!caster->IsWithinDistInMap(m_target, max_range))
12377 12377 {
6 src/game/SpellEffects.cpp
@@ -6432,7 +6432,7 @@ void Spell::EffectDispel(SpellEffectIndex eff_idx)
6432 6432 if (Unit *caster = holder->GetCaster())
6433 6433 {
6434 6434 if (Player* modOwner = caster->GetSpellModOwner() )
6435   - modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, this);
  6435 + modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance);
6436 6436 }
6437 6437 // Try dispel
6438 6438 if (roll_chance_i(miss_chance))
@@ -12256,7 +12256,7 @@ void Spell::EffectStealBeneficialBuff(SpellEffectIndex eff_idx)
12256 12256
12257 12257 if (Player* modOwner = caster->GetSpellModOwner())
12258 12258 {
12259   - modOwner->ApplySpellMod(holder->GetSpellProto()->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, this);
  12259 + modOwner->ApplySpellMod(holder->GetSpellProto()->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance);
12260 12260 miss_chance += modOwner->GetTotalAuraModifier(SPELL_AURA_MOD_DISPEL_RESIST);
12261 12261 }
12262 12262
@@ -12264,7 +12264,7 @@ void Spell::EffectStealBeneficialBuff(SpellEffectIndex eff_idx)
12264 12264 {
12265 12265 if (Player* modOwner = target->GetSpellModOwner())
12266 12266 {
12267   - modOwner->ApplySpellMod(holder->GetSpellProto()->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, this);
  12267 + modOwner->ApplySpellMod(holder->GetSpellProto()->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance);
12268 12268 miss_chance += modOwner->GetTotalAuraModifier(SPELL_AURA_MOD_DISPEL_RESIST);
12269 12269 }
12270 12270 }
2  src/game/SpellMgr.cpp
@@ -131,7 +131,7 @@ uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell)
131 131 castTime /= 2;
132 132
133 133 if (Player* modOwner = spell->GetCaster()->GetSpellModOwner())
134   - modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, castTime, spell);
  134 + modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, castTime);
135 135
136 136 if (!(spellInfo->Attributes & (SPELL_ATTR_ABILITY|SPELL_ATTR_TRADESPELL)))
137 137 castTime = int32(castTime * spell->GetCaster()->GetFloatValue(UNIT_MOD_CAST_SPEED));
2  src/game/Unit.cpp
@@ -6069,7 +6069,7 @@ void Unit::AddGameObject(GameObject* gameObj)
6069 6069 // Need disable spell use for owner
6070 6070 if (createBySpell && createBySpell->HasAttribute(SPELL_ATTR_DISABLED_WHILE_ACTIVE))
6071 6071 // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existing cases)
6072   - ((Player*)this)->AddSpellAndCategoryCooldowns(createBySpell, 0, NULL, true);
  6072 + ((Player*)this)->AddSpellAndCategoryCooldowns(createBySpell, 0, true);
6073 6073 }
6074 6074 }
6075 6075
4 src/game/UnitAuraProcHandler.cpp
@@ -2021,7 +2021,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, DamageInfo* damageI
2021 2021 else
2022 2022 radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(procSpell->rangeIndex));
2023 2023
2024   - ((Player*)this)->ApplySpellMod(procSpell->Id, SPELLMOD_RADIUS, radius,NULL);
  2024 + ((Player*)this)->ApplySpellMod(procSpell->Id, SPELLMOD_RADIUS, radius);
2025 2025
2026 2026 Unit *second = pVictim->SelectRandomFriendlyTarget(pVictim, radius);
2027 2027
@@ -4797,7 +4797,7 @@ SpellAuraProcResult Unit::HandleMendingAuraProc( Unit* /*pVictim*/, DamageInfo*
4797 4797
4798 4798 if (Player* caster = ((Player*)triggeredByAura->GetCaster()))
4799 4799 {
4800   - caster->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius, NULL);
  4800 + caster->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius);
4801 4801
4802 4802 SpellAuraHolderPtr holder = GetSpellAuraHolder(spellProto->Id, caster->GetObjectGuid());
4803 4803
2  src/game/playerbot/PlayerbotAI.cpp
@@ -335,7 +335,7 @@ uint32 PlayerbotAI::initSpell(uint32 spellId)
335 335 Spell *spell = new Spell(m_bot, pSpellInfo, false);
336 336 SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(pSpellInfo->rangeIndex);
337 337 float range = GetSpellMaxRange(srange, IsPositiveSpell(spellId));
338   - m_bot->ApplySpellMod(spellId, SPELLMOD_RANGE, range, spell);
  338 + m_bot->ApplySpellMod(spellId, SPELLMOD_RANGE, range);
339 339 m_spellRangeMap.insert(std::pair<uint32, float>(spellId, range));
340 340 delete spell;
341 341 }
2  src/shared/revision_R2.h
... ... @@ -1,4 +1,4 @@
1 1 #ifndef __REVISION_R2_H__
2 2 #define __REVISION_R2_H__
3   - #define REVISION_R2 "2106"
  3 + #define REVISION_R2 "2107"
4 4 #endif // __REVISION_R2_H__

0 comments on commit ba877fd

Please sign in to comment.
Something went wrong with that request. Please try again.