Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[mr2107] remove unused variable in ApplySpellMod

  • Loading branch information...
commit ba877fd82e81b93aed634351cb40449f4156800b 1 parent 2d5578c
@Reamer Reamer authored
View
20 src/game/Player.cpp
@@ -19894,7 +19894,7 @@ void Player::AddSpellMod(Aura* aura, bool apply)
m_spellMods[mod->m_miscvalue].remove(aura);
}
-template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell const* spell)
+template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue)
{
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
if (!spellInfo)
@@ -19933,9 +19933,9 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
return T(diff);
}
-template int32 Player::ApplySpellMod<int32>(uint32 spellId, SpellModOp op, int32 &basevalue, Spell const* spell);
-template uint32 Player::ApplySpellMod<uint32>(uint32 spellId, SpellModOp op, uint32 &basevalue, Spell const* spell);
-template float Player::ApplySpellMod<float>(uint32 spellId, SpellModOp op, float &basevalue, Spell const* spell);
+template int32 Player::ApplySpellMod<int32>(uint32 spellId, SpellModOp op, int32 &basevalue);
+template uint32 Player::ApplySpellMod<uint32>(uint32 spellId, SpellModOp op, uint32 &basevalue);
+template float Player::ApplySpellMod<float>(uint32 spellId, SpellModOp op, float &basevalue);
// send Proficiency
void Player::SendProficiency(ItemClass itemClass, uint32 itemSubclassMask)
@@ -20777,7 +20777,7 @@ void Player::UpdatePvP(bool state, bool ovrride)
}
}
-void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, Spell* spell, bool infinityCooldown)
+void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, bool infinityCooldown)
{
// init cooldown values
uint32 cat = 0;
@@ -20835,10 +20835,10 @@ void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 it
// Now we have cooldown data (if found any), time to apply mods
if (rec > 0)
- ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, rec, spell);
+ ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, rec);
if (catrec > 0)
- ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, catrec, spell);
+ ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, catrec);
// replace negative cooldowns by 0
if (rec < 0) rec = 0;
@@ -20882,10 +20882,10 @@ void Player::AddSpellCooldown(uint32 spellid, uint32 itemid, time_t end_time)
m_spellCooldowns[spellid] = sc;
}
-void Player::SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId, Spell* spell)
+void Player::SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId)
{
// start cooldowns at server side, if any
- AddSpellAndCategoryCooldowns(spellInfo, itemId, spell);
+ AddSpellAndCategoryCooldowns(spellInfo, itemId);
// Send activate cooldown timer (possible 0) at client side
WorldPacket data(SMSG_COOLDOWN_EVENT, (4+8));
@@ -20912,7 +20912,7 @@ void Player::UpdatePotionCooldown(Spell* spell)
}
// from spell cases (m_lastPotionId set in Spell::SendSpellCooldown)
else
- SendCooldownEvent(spell->m_spellInfo,m_lastPotionId,spell);
+ SendCooldownEvent(spell->m_spellInfo,m_lastPotionId);
m_lastPotionId = 0;
}
View
6 src/game/Player.h
@@ -1698,7 +1698,7 @@ class MANGOS_DLL_SPEC Player : public Unit
SpellEntry const* GetKnownTalentRankById(int32 talentId) const;
void AddSpellMod(Aura* aura, bool apply);
- template <class T> T ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell const* spell = NULL);
+ template <class T> T ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue);
static uint32 const infinityCooldownDelay = MONTH; // used for set "infinity cooldowns" for spells and check
static uint32 const infinityCooldownDelayCheck = MONTH/2;
@@ -1713,9 +1713,9 @@ class MANGOS_DLL_SPEC Player : public Unit
time_t t = time(NULL);
return itr != m_spellCooldowns.end() && itr->second.end > t ? itr->second.end - t : 0;
}
- void AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, Spell* spell = NULL, bool infinityCooldown = false );
+ void AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, bool infinityCooldown = false );
void AddSpellCooldown(uint32 spell_id, uint32 itemid, time_t end_time);
- void SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId = 0, Spell* spell = NULL);
+ void SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId = 0);
void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs );
void RemoveSpellCooldown(uint32 spell_id, bool update = false);
void RemoveSpellCategoryCooldown(uint32 cat, bool update = false);
View
30 src/game/Spell.cpp
@@ -1326,7 +1326,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
// Apply multiplier mods
if (real_caster)
if (Player* modOwner = real_caster->GetSpellModOwner())
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_EFFECT_PAST_FIRST, multiplier, this);
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_EFFECT_PAST_FIRST, multiplier);
m_damageMultipliers[effectNumber] *= multiplier;
}
@@ -1622,7 +1622,7 @@ void Spell::HandleDelayedSpellLaunch(TargetInfo *target)
// Apply multiplier mods
if (real_caster)
if (Player* modOwner = real_caster->GetSpellModOwner())
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_EFFECT_PAST_FIRST, multiplier, this);
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_EFFECT_PAST_FIRST, multiplier);
m_damageMultipliers[effectNumber] *= multiplier;
}
}
@@ -1642,7 +1642,7 @@ void Spell::InitializeDamageMultipliers()
uint32 EffectChainTarget = m_spellInfo->EffectChainTarget[i];
if (Unit* realCaster = GetAffectiveCaster())
if (Player* modOwner = realCaster->GetSpellModOwner())
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, EffectChainTarget, this);
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, EffectChainTarget);
m_damageMultipliers[i] = 1.0f;
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&
{
if (Player* modOwner = realCaster->GetSpellModOwner())
{
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius, this);
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, EffectChainTarget, this);
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius);
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, EffectChainTarget);
}
}
@@ -2082,7 +2082,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
//Glyph of blink or etc this type
if (m_caster->GetTypeId() == TYPEID_PLAYER)
- ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, distance, this);
+ ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, distance);
float fx = target->GetPositionX() + distance * cos(direction);
float fy = target->GetPositionY() + distance * sin(direction);
@@ -4138,7 +4138,7 @@ void Spell::SendSpellCooldown()
if (m_spellInfo->HasAttribute(SPELL_ATTR_DISABLED_WHILE_ACTIVE) || m_spellInfo->HasAttribute(SPELL_ATTR_PASSIVE))
return;
- _player->AddSpellAndCategoryCooldowns(m_spellInfo, m_CastItem ? m_CastItem->GetEntry() : 0, this);
+ _player->AddSpellAndCategoryCooldowns(m_spellInfo, m_CastItem ? m_CastItem->GetEntry() : 0);
}
void Spell::update(uint32 difftime)
@@ -5120,7 +5120,7 @@ void Spell::TakePower()
if (needApplyMod)
if (Player* modOwner = m_caster->GetSpellModOwner())
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST_ON_HIT_FAIL, m_powerCost, this);
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST_ON_HIT_FAIL, m_powerCost);
m_caster->ModifyPower(powerType, -(int32)m_powerCost);
@@ -5161,7 +5161,7 @@ SpellCastResult Spell::CheckOrTakeRunePower(bool take)
// at this moment for rune cost exist only no cost mods, and no percent mods
int32 runeCostMod = 10000;
if (Player* modOwner = plr->GetSpellModOwner())
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, runeCostMod, this);
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, runeCostMod);
if (runeCostMod > 0)
{
@@ -7066,7 +7066,7 @@ SpellCastResult Spell::CheckRange(bool strict, WorldObject* checkTarget)
float range_mod = combat_range + add_range;
if (Player* modOwner = m_caster->GetSpellModOwner())
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range_mod, this);
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range_mod);
float range_delta = range_mod - combat_range;
@@ -7082,7 +7082,7 @@ SpellCastResult Spell::CheckRange(bool strict, WorldObject* checkTarget)
}
if (Player* modOwner = m_caster->GetSpellModOwner())
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, max_range, this);
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, max_range);
if (target && target != m_caster)
{
@@ -7181,7 +7181,7 @@ int32 Spell::CalculatePowerCost(SpellEntry const* spellInfo, Unit* caster, Spell
// Apply cost mod by spell
if (spell)
if (Player* modOwner = caster->GetSpellModOwner())
- modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_COST, powerCost, spell);
+ modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_COST, powerCost);
if (spellInfo->HasAttribute(SPELL_ATTR_LEVEL_DAMAGE_CALCULATION))
powerCost = int32(powerCost/ (1.117f * spellInfo->spellLevel / caster->getLevel() -0.1327f));
@@ -7723,7 +7723,7 @@ void Spell::Delayed()
// check pushback reduce
int32 delaytime = 500; // spellcasting delay is normally 500ms
int32 delayReduce = 100; // must be initialized to 100 for percent modifiers
- ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_NOT_LOSE_CASTING_TIME, delayReduce, this);
+ ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_NOT_LOSE_CASTING_TIME, delayReduce);
delayReduce += m_caster->GetTotalAuraModifier(SPELL_AURA_REDUCE_PUSHBACK) - 100;
if (delayReduce >= 100)
return;
@@ -7758,7 +7758,7 @@ void Spell::DelayedChannel()
// check pushback reduce
int32 delaytime = GetSpellDuration(m_spellInfo) * 25 / 100;// channeling delay is normally 25% of its time per hit
int32 delayReduce = 100; // must be initialized to 100 for percent modifiers
- ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_NOT_LOSE_CASTING_TIME, delayReduce, this);
+ ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_NOT_LOSE_CASTING_TIME, delayReduce);
delayReduce += m_caster->GetTotalAuraModifier(SPELL_AURA_REDUCE_PUSHBACK) - 100;
if (delayReduce >= 100)
return;
@@ -8425,7 +8425,7 @@ void Spell::TriggerGlobalCooldown()
{
// gcd modifier auras applied only to self spells and only player have mods for this
if (m_caster->GetTypeId() == TYPEID_PLAYER)
- ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_GLOBAL_COOLDOWN, gcd, this);
+ ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id, SPELLMOD_GLOBAL_COOLDOWN, gcd);
// apply haste rating
gcd = int32(float(gcd) * m_caster->GetFloatValue(UNIT_MOD_CAST_SPEED));
View
4 src/game/SpellAuras.cpp
@@ -10630,7 +10630,7 @@ void SpellAuraHolder::_AddSpellAuraHolder()
if (m_spellProto->HasAttribute(SPELL_ATTR_DISABLED_WHILE_ACTIVE))
{
Item* castItem = m_castItemGuid ? ((Player*)caster)->GetItemByGuid(m_castItemGuid) : NULL;
- ((Player*)caster)->AddSpellAndCategoryCooldowns(m_spellProto,castItem ? castItem->GetEntry() : 0, NULL,true);
+ ((Player*)caster)->AddSpellAndCategoryCooldowns(m_spellProto,castItem ? castItem->GetEntry() : 0,true);
}
}
@@ -12371,7 +12371,7 @@ void SpellAuraHolder::Update(uint32 diff)
float max_range = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellProto->rangeIndex));
if(Player* modOwner = caster->GetSpellModOwner())
- modOwner->ApplySpellMod(GetId(), SPELLMOD_RANGE, max_range, NULL);
+ modOwner->ApplySpellMod(GetId(), SPELLMOD_RANGE, max_range);
if(!caster->IsWithinDistInMap(m_target, max_range))
{
View
6 src/game/SpellEffects.cpp
@@ -6432,7 +6432,7 @@ void Spell::EffectDispel(SpellEffectIndex eff_idx)
if (Unit *caster = holder->GetCaster())
{
if (Player* modOwner = caster->GetSpellModOwner() )
- modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, this);
+ modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance);
}
// Try dispel
if (roll_chance_i(miss_chance))
@@ -12256,7 +12256,7 @@ void Spell::EffectStealBeneficialBuff(SpellEffectIndex eff_idx)
if (Player* modOwner = caster->GetSpellModOwner())
{
- modOwner->ApplySpellMod(holder->GetSpellProto()->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, this);
+ modOwner->ApplySpellMod(holder->GetSpellProto()->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance);
miss_chance += modOwner->GetTotalAuraModifier(SPELL_AURA_MOD_DISPEL_RESIST);
}
@@ -12264,7 +12264,7 @@ void Spell::EffectStealBeneficialBuff(SpellEffectIndex eff_idx)
{
if (Player* modOwner = target->GetSpellModOwner())
{
- modOwner->ApplySpellMod(holder->GetSpellProto()->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, this);
+ modOwner->ApplySpellMod(holder->GetSpellProto()->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance);
miss_chance += modOwner->GetTotalAuraModifier(SPELL_AURA_MOD_DISPEL_RESIST);
}
}
View
2  src/game/SpellMgr.cpp
@@ -131,7 +131,7 @@ uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell)
castTime /= 2;
if (Player* modOwner = spell->GetCaster()->GetSpellModOwner())
- modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, castTime, spell);
+ modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, castTime);
if (!(spellInfo->Attributes & (SPELL_ATTR_ABILITY|SPELL_ATTR_TRADESPELL)))
castTime = int32(castTime * spell->GetCaster()->GetFloatValue(UNIT_MOD_CAST_SPEED));
View
2  src/game/Unit.cpp
@@ -6069,7 +6069,7 @@ void Unit::AddGameObject(GameObject* gameObj)
// Need disable spell use for owner
if (createBySpell && createBySpell->HasAttribute(SPELL_ATTR_DISABLED_WHILE_ACTIVE))
// note: item based cooldowns and cooldown spell mods with charges ignored (unknown existing cases)
- ((Player*)this)->AddSpellAndCategoryCooldowns(createBySpell, 0, NULL, true);
+ ((Player*)this)->AddSpellAndCategoryCooldowns(createBySpell, 0, true);
}
}
View
4 src/game/UnitAuraProcHandler.cpp
@@ -2021,7 +2021,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, DamageInfo* damageI
else
radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(procSpell->rangeIndex));
- ((Player*)this)->ApplySpellMod(procSpell->Id, SPELLMOD_RADIUS, radius,NULL);
+ ((Player*)this)->ApplySpellMod(procSpell->Id, SPELLMOD_RADIUS, radius);
Unit *second = pVictim->SelectRandomFriendlyTarget(pVictim, radius);
@@ -4797,7 +4797,7 @@ SpellAuraProcResult Unit::HandleMendingAuraProc( Unit* /*pVictim*/, DamageInfo*
if (Player* caster = ((Player*)triggeredByAura->GetCaster()))
{
- caster->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius, NULL);
+ caster->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius);
SpellAuraHolderPtr holder = GetSpellAuraHolder(spellProto->Id, caster->GetObjectGuid());
View
2  src/game/playerbot/PlayerbotAI.cpp
@@ -335,7 +335,7 @@ uint32 PlayerbotAI::initSpell(uint32 spellId)
Spell *spell = new Spell(m_bot, pSpellInfo, false);
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(pSpellInfo->rangeIndex);
float range = GetSpellMaxRange(srange, IsPositiveSpell(spellId));
- m_bot->ApplySpellMod(spellId, SPELLMOD_RANGE, range, spell);
+ m_bot->ApplySpellMod(spellId, SPELLMOD_RANGE, range);
m_spellRangeMap.insert(std::pair<uint32, float>(spellId, range));
delete spell;
}
View
2  src/shared/revision_R2.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_R2_H__
#define __REVISION_R2_H__
- #define REVISION_R2 "2106"
+ #define REVISION_R2 "2107"
#endif // __REVISION_R2_H__
Please sign in to comment.
Something went wrong with that request. Please try again.