aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells
diff options
context:
space:
mode:
authorSpp <none@none>2010-08-30 15:25:15 +0200
committerSpp <none@none>2010-08-30 15:25:15 +0200
commit405f312918136510fde921403ffffa315bdbcb4b (patch)
tree1543ab9fe023fcb6ce03d31070917cff527b2e88 /src/server/game/Spells
parentb0d85ac1858ecc162adb08a8de1b3da68121ce64 (diff)
Core: Fix more warnings
--HG-- branch : trunk
Diffstat (limited to 'src/server/game/Spells')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp28
-rw-r--r--src/server/game/Spells/Spell.cpp10
-rw-r--r--src/server/game/Spells/SpellEffects.cpp40
3 files changed, 45 insertions, 33 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 2fc836c76ca..228b4dcadad 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -1228,7 +1228,7 @@ bool AuraEffect::IsPeriodicTickCrit(Unit * target, Unit const * caster) const
return true;
}
// Rupture - since 3.3.3 can crit
- if (AuraEffect *AuraRupture = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x100000, 0x0, 0x0, caster->GetGUID()))
+ if (target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x100000, 0x0, 0x0, caster->GetGUID()))
{
if (caster->isSpellCrit(target, m_spellProto, GetSpellSchoolMask(m_spellProto)))
return true;
@@ -1604,7 +1604,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
}
case SPELL_AURA_PERIODIC_MANA_LEECH:
{
- if (GetMiscValue() < 0 || GetMiscValue() >= MAX_POWERS)
+ if (GetMiscValue() < 0 || GetMiscValue() >= int8(MAX_POWERS))
break;
Powers power = Powers(GetMiscValue());
@@ -1739,7 +1739,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
case SPELL_AURA_PERIODIC_ENERGIZE:
{
// ignore non positive values (can be result apply spellmods to aura damage
- if (m_amount < 0 || GetMiscValue() >= MAX_POWERS)
+ if (m_amount < 0 || GetMiscValue() >= int8(MAX_POWERS))
return;
Powers power = Powers(GetMiscValue());
@@ -2599,7 +2599,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit * target, bool apply) const
{
case FORM_CAT:
// Savage Roar
- if (AuraEffect const * aurEff = target->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_DRUID, 0 , 0x10000000, 0))
+ if (target->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_DRUID, 0 , 0x10000000, 0))
target->CastSpell(target, 62071, true);
// Nurturing Instinct
if (AuraEffect const * aurEff = target->GetAuraEffect(SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT, SPELLFAMILY_DRUID, 2254, 0))
@@ -2859,12 +2859,22 @@ void AuraEffect::HandlePhase(AuraApplication const * aurApp, uint8 mode, bool ap
// GM-mode have mask 0xFFFFFFFF
if (!target->ToPlayer()->isGameMaster())
- target->SetPhaseMask((apply) ? GetMiscValue() : PHASEMASK_NORMAL,false);
-
- target->ToPlayer()->GetSession()->SendSetPhaseShift((apply) ? GetMiscValue() : PHASEMASK_NORMAL);
+ {
+ if (apply)
+ target->SetPhaseMask(GetMiscValue(), false);
+ else
+ target->SetPhaseMask(PHASEMASK_NORMAL, false);
+ }
+
+ if (apply)
+ target->ToPlayer()->GetSession()->SendSetPhaseShift(GetMiscValue());
+ else
+ target->ToPlayer()->GetSession()->SendSetPhaseShift(PHASEMASK_NORMAL);
}
+ else if (apply)
+ target->SetPhaseMask(GetMiscValue(), false);
else
- target->SetPhaseMask((apply) ? GetMiscValue() : PHASEMASK_NORMAL,false);
+ target->SetPhaseMask(PHASEMASK_NORMAL, false);
// need triggering visibility update base at phase update of not GM invisible (other GMs anyway see in any phases)
if (target->GetVisibility() != VISIBILITY_OFF)
@@ -6230,7 +6240,7 @@ void AuraEffect::HandleForceReaction(AuraApplication const * aurApp, uint8 mode,
player->GetReputationMgr().SendForceReactions();
// stop fighting if at apply forced rank friendly or at remove real rank friendly
- if (apply && faction_rank >= REP_FRIENDLY || !apply && player->GetReputationRank(faction_id) >= REP_FRIENDLY)
+ if ((apply && faction_rank >= REP_FRIENDLY) || (!apply && player->GetReputationRank(faction_id) >= REP_FRIENDLY))
player->StopAttackFaction(faction_id);
}
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 457bc1e019b..af9ad32490f 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2750,7 +2750,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
if (maxSize && power != -1)
{
- if (power == POWER_HEALTH)
+ if (Powers(power) == POWER_HEALTH)
{
if (unitList.size() > maxSize)
{
@@ -4172,7 +4172,7 @@ void Spell::ExecuteLogEffectInterruptCast(uint8 effIndex, Unit * victim, uint32
*m_effectExecuteData[effIndex] << uint32(spellId);
}
-void Spell::ExecuteLogEffectDurabilityDamage(uint8 effIndex, Unit * victim, uint32 itemslot, uint32 damage)
+void Spell::ExecuteLogEffectDurabilityDamage(uint8 effIndex, Unit * victim, uint32 /*itemslot*/, uint32 damage)
{
InitEffectExecuteData(effIndex);
m_effectExecuteData[effIndex]->append(victim->GetPackGUID());
@@ -5297,7 +5297,7 @@ SpellCastResult Spell::CheckCast(bool strict)
// Can be area effect, Check only for players and not check if target - caster (spell can have multiply drain/burn effects)
if (m_caster->GetTypeId() == TYPEID_PLAYER)
if (Unit* target = m_targets.getUnitTarget())
- if (target != m_caster && target->getPowerType() != m_spellInfo->EffectMiscValue[i])
+ if (target != m_caster && target->getPowerType() != Powers(m_spellInfo->EffectMiscValue[i]))
return SPELL_FAILED_BAD_TARGETS;
break;
}
@@ -6054,7 +6054,7 @@ SpellCastResult Spell::CheckItems()
// Mana Potion, Rage Potion, Thistle Tea(Rogue), ...
if (m_spellInfo->Effect[i] == SPELL_EFFECT_ENERGIZE)
{
- if (m_spellInfo->EffectMiscValue[i] < 0 || m_spellInfo->EffectMiscValue[i] >= MAX_POWERS)
+ if (m_spellInfo->EffectMiscValue[i] < 0 || m_spellInfo->EffectMiscValue[i] >= int8(MAX_POWERS))
{
failReason = SPELL_FAILED_ALREADY_AT_FULL_POWER;
continue;
@@ -6982,7 +6982,7 @@ void Spell::CalculateDamageDoneForAllTargets()
}
}
-int32 Spell::CalculateDamageDone(Unit *unit, const uint32 effectMask, float *multiplier)
+int32 Spell::CalculateDamageDone(Unit *unit, const uint32 effectMask, float * /*multiplier*/)
{
int32 damageDone = 0;
unitTarget = unit;
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index c38fb902801..749f858e212 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -858,19 +858,19 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
uint32 effect = 0;
uint32 rand = urand(0, 100);
- if (rand >= 0 && rand < 25) // Fireball (25% chance)
+ if (rand < 25) // Fireball (25% chance)
effect = ClearSpellId[0];
- else if (rand >= 25 && rand < 50) // Frostball (25% chance)
+ else if (rand < 50) // Frostball (25% chance)
effect = ClearSpellId[1];
- else if (rand >=50 && rand < 70) // Chain Lighting (25% chance)
+ else if (rand < 70) // Chain Lighting (25% chance)
effect = ClearSpellId[2];
- else if (rand >= 70 && rand < 80) // Polymorph (10% chance)
+ else if (rand < 80) // Polymorph (10% chance)
{
effect = ClearSpellId[3];
if (urand(0, 100) <= 30) // 30% chance to self-cast
unitTarget = m_caster;
}
- else if (rand >=80 && rand < 95) // Enveloping Winds (15% chance)
+ else if (rand < 95) // Enveloping Winds (15% chance)
effect = ClearSpellId[4];
else // Summon Felhund minion (5% chance)
{
@@ -1524,7 +1524,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return;
- if (Item *item = m_caster->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
+ if (m_caster->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
{
// Damage is increased by 25% if your off-hand weapon is enchanted with Flametongue.
if (m_caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000, 0, 0))
@@ -2193,7 +2193,7 @@ void Spell::EffectUnlearnSpecialization(SpellEffIndex effIndex)
void Spell::EffectPowerDrain(SpellEffIndex effIndex)
{
- if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= MAX_POWERS)
+ if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= int8(MAX_POWERS))
return;
Powers powerType = Powers(m_spellInfo->EffectMiscValue[effIndex]);
@@ -2247,7 +2247,7 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex)
void Spell::EffectPowerBurn(SpellEffIndex effIndex)
{
- if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= MAX_POWERS)
+ if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= int8(MAX_POWERS))
return;
Powers powerType = Powers(m_spellInfo->EffectMiscValue[effIndex]);
@@ -2647,7 +2647,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex)
if (!unitTarget->isAlive())
return;
- if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= MAX_POWERS)
+ if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= int8(MAX_POWERS))
return;
Powers power = Powers(m_spellInfo->EffectMiscValue[effIndex]);
@@ -2749,7 +2749,7 @@ void Spell::EffectEnergizePct(SpellEffIndex effIndex)
if (!unitTarget->isAlive())
return;
- if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= MAX_POWERS)
+ if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= int8(MAX_POWERS))
return;
Powers power = Powers(m_spellInfo->EffectMiscValue[effIndex]);
@@ -2837,8 +2837,8 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex)
{
GameObjectInfo const* goInfo = gameObjTarget->GetGOInfo();
// Arathi Basin banner opening !
- if (goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune ||
- goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK)
+ if ((goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune) ||
+ (goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK))
{
//CanUseBattlegroundObject() already called in CheckCast()
// in battleground check
@@ -4133,7 +4133,7 @@ void Spell::SpellDamageWeaponDmg(SpellEffIndex effIndex)
totalDamagePercentMod *= (float(unitTarget->GetDiseasesByCaster(m_caster->GetGUID())) * 12.5f + 100.0f) / 100.0f;
// Glyph of Blood Strike
- if (AuraEffect * aurEff = m_caster->GetAuraEffect(59332,0))
+ if (m_caster->GetAuraEffect(59332,0))
{
if (unitTarget->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED))
totalDamagePercentMod *= float((20 + 100.0f) / 100.0f);
@@ -4143,7 +4143,7 @@ void Spell::SpellDamageWeaponDmg(SpellEffIndex effIndex)
else if (m_spellInfo->SpellFamilyFlags[0] & 0x00000010)
{
// Glyph of Death Strike
- if (AuraEffect * aurEff = m_caster->GetAuraEffect(59336,0))
+ if (m_caster->GetAuraEffect(59336,0))
{
if (uint32 runic = m_caster->GetPower(POWER_RUNIC_POWER))
{
@@ -4304,7 +4304,7 @@ void Spell::EffectInterruptCast(SpellEffIndex effIndex)
SpellEntry const* curSpellInfo = spell->m_spellInfo;
// check if we can interrupt spell
if ((spell->getState() == SPELL_STATE_CASTING
- || spell->getState() == SPELL_STATE_PREPARING && spell->GetCastTime() > 0.0f)
+ || (spell->getState() == SPELL_STATE_PREPARING && spell->GetCastTime() > 0.0f))
&& curSpellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_INTERRUPT && curSpellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
{
if (m_originalCaster)
@@ -4691,7 +4691,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
uint8 slot = 0;
Item *item = NULL;
- while (bag < 256)
+ while (bag) // 256 = 0 due to var type
{
item = m_caster->ToPlayer()->GetItemByPos(bag, slot);
if (item && item->GetEntry() == 38587) break;
@@ -4702,7 +4702,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
++bag;
}
}
- if (bag < 256)
+ if (bag)
{
if (m_caster->ToPlayer()->GetItemByPos(bag,slot)->GetCount() == 1) m_caster->ToPlayer()->RemoveItem(bag,slot,true);
else m_caster->ToPlayer()->GetItemByPos(bag,slot)->SetCount(m_caster->ToPlayer()->GetItemByPos(bag,slot)->GetCount()-1);
@@ -4754,7 +4754,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
case 47770:
{
char buf[128];
- char *gender = "his";
+ const char *gender = "his";
if (m_caster->getGender() > 0)
gender = "her";
sprintf(buf, "%s rubs %s [Decahedral Dwarven Dice] between %s hands and rolls. One %u and one %u.", m_caster->GetName(), gender, gender, urand(1,10), urand(1,10));
@@ -4765,7 +4765,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
case 47776:
{
char buf[128];
- char *gender = "his";
+ const char *gender = "his";
if (m_caster->getGender() > 0)
gender = "her";
sprintf(buf, "%s causually tosses %s [Worn Troll Dice]. One %u and one %u.", m_caster->GetName(), gender, urand(1,6), urand(1,6));
@@ -6936,6 +6936,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const *
((Minion*)summon)->SetFollowAngle(m_caster->GetAngle(summon));
if (summon->GetEntry() == 27893)
+ {
if (uint32 weapon = m_caster->GetUInt32Value(PLAYER_VISIBLE_ITEM_16_ENTRYID))
{
summon->SetDisplayId(11686);
@@ -6943,6 +6944,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const *
}
else
summon->SetDisplayId(1126);
+ }
summon->AI()->EnterEvadeMode();