mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[10692] Fixed some GCC warnings and code errors.
Thanks to freghar for provide cleaned list of warning messages.
This commit is contained in:
parent
349719e520
commit
10d3d3ce24
33 changed files with 363 additions and 306 deletions
|
|
@ -390,7 +390,7 @@ m_isPersistent(false), m_in_use(0), m_spellAuraHolder(holder)
|
|||
m_applyTime = time(NULL);
|
||||
|
||||
int32 damage;
|
||||
if(!caster)
|
||||
if (!caster)
|
||||
{
|
||||
damage = m_currentBasePoints;
|
||||
m_maxduration = target->CalculateSpellDuration(spellproto, m_effIndex, target);
|
||||
|
|
@ -403,34 +403,36 @@ m_isPersistent(false), m_in_use(0), m_spellAuraHolder(holder)
|
|||
if (!damage && castItem && castItem->GetItemSuffixFactor())
|
||||
{
|
||||
ItemRandomSuffixEntry const *item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(castItem->GetItemRandomPropertyId()));
|
||||
if(item_rand_suffix)
|
||||
if (item_rand_suffix)
|
||||
{
|
||||
for (int k = 0; k < 3; ++k)
|
||||
{
|
||||
SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->enchant_id[k]);
|
||||
if(pEnchant)
|
||||
if (pEnchant)
|
||||
{
|
||||
for (int t = 0; t < 3; ++t)
|
||||
if(pEnchant->spellid[t] == spellproto->Id)
|
||||
{
|
||||
if(pEnchant->spellid[t] != spellproto->Id)
|
||||
continue;
|
||||
|
||||
damage = uint32((item_rand_suffix->prefix[k]*castItem->GetItemSuffixFactor()) / 10000 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(damage)
|
||||
if (damage)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(m_maxduration == -1 || isPassive && spellproto->DurationIndex == 0)
|
||||
if (m_maxduration == -1 || (isPassive && spellproto->DurationIndex == 0))
|
||||
isPermanent = true;
|
||||
|
||||
Player* modOwner = caster ? caster->GetSpellModOwner() : NULL;
|
||||
|
||||
if(!isPermanent && modOwner)
|
||||
if (!isPermanent && modOwner)
|
||||
{
|
||||
modOwner->ApplySpellMod(spellproto->Id, SPELLMOD_DURATION, m_maxduration);
|
||||
// Get zero duration aura after - need set m_maxduration > 0 for apply/remove aura work
|
||||
|
|
@ -961,7 +963,7 @@ void Aura::ReapplyAffectedPassiveAuras( Unit* target, bool owner_mode )
|
|||
{
|
||||
// permanent passive or permanent area aura
|
||||
// passive spells can be affected only by own or owner spell mods)
|
||||
if (itr->second->IsPermanent() && (owner_mode && itr->second->IsPassive() || itr->second->IsAreaAura()) &&
|
||||
if ((itr->second->IsPermanent() && (owner_mode && itr->second->IsPassive() || itr->second->IsAreaAura())) &&
|
||||
// non deleted and not same aura (any with same spell id)
|
||||
!itr->second->IsDeleted() && itr->second->GetId() != GetId() &&
|
||||
// and affected by aura
|
||||
|
|
@ -2903,10 +2905,10 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
|
|||
uint32 aurMechMask = GetAllSpellMechanicMask(aurSpellInfo);
|
||||
|
||||
// If spell that caused this aura has Croud Control or Daze effect
|
||||
if((aurMechMask & MECHANIC_NOT_REMOVED_BY_SHAPESHIFT) ||
|
||||
if ((aurMechMask & MECHANIC_NOT_REMOVED_BY_SHAPESHIFT) ||
|
||||
// some Daze spells have these parameters instead of MECHANIC_DAZE (skip snare spells)
|
||||
aurSpellInfo->SpellIconID == 15 && aurSpellInfo->Dispel == 0 &&
|
||||
(aurMechMask & (1 << (MECHANIC_SNARE-1)))==0)
|
||||
(aurSpellInfo->SpellIconID == 15 && aurSpellInfo->Dispel == 0 &&
|
||||
(aurMechMask & (1 << (MECHANIC_SNARE-1))) == 0))
|
||||
{
|
||||
++iter;
|
||||
continue;
|
||||
|
|
@ -3259,7 +3261,7 @@ void Aura::HandleForceReaction(bool apply, bool Real)
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
@ -3278,16 +3280,16 @@ void Aura::HandleAuraModSkill(bool apply, bool /*Real*/)
|
|||
|
||||
void Aura::HandleChannelDeathItem(bool apply, bool Real)
|
||||
{
|
||||
if(Real && !apply)
|
||||
if (Real && !apply)
|
||||
{
|
||||
if(m_removeMode != AURA_REMOVE_BY_DEATH)
|
||||
if (m_removeMode != AURA_REMOVE_BY_DEATH)
|
||||
return;
|
||||
// Item amount
|
||||
if (m_modifier.m_amount <= 0)
|
||||
return;
|
||||
|
||||
SpellEntry const *spellInfo = GetSpellProto();
|
||||
if(spellInfo->EffectItemType[m_effIndex] == 0)
|
||||
if (spellInfo->EffectItemType[m_effIndex] == 0)
|
||||
return;
|
||||
|
||||
Unit* victim = GetTarget();
|
||||
|
|
@ -3300,7 +3302,7 @@ void Aura::HandleChannelDeathItem(bool apply, bool Real)
|
|||
{
|
||||
// Only from non-grey units
|
||||
if (!((Player*)caster)->isHonorOrXPTarget(victim) ||
|
||||
victim->GetTypeId() == TYPEID_UNIT && !((Player*)caster)->isAllowedToLoot((Creature*)victim))
|
||||
(victim->GetTypeId() == TYPEID_UNIT && !((Player*)caster)->isAllowedToLoot((Creature*)victim)))
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -7798,7 +7800,7 @@ m_permanent(false), m_isRemovedOnShapeLost(true), m_deleted(false), m_in_use(0)
|
|||
m_isDeathPersist = IsDeathPersistentSpell(m_spellProto);
|
||||
m_isSingleTarget = IsSingleTargetSpell(spellproto);
|
||||
|
||||
if(GetSpellMaxDuration(m_spellProto) == -1 || m_isPassive && m_spellProto->DurationIndex == 0)
|
||||
if (GetSpellMaxDuration(m_spellProto) == -1 || (m_isPassive && m_spellProto->DurationIndex == 0))
|
||||
m_permanent = true;
|
||||
|
||||
m_isRemovedOnShapeLost = (m_caster_guid==m_target->GetGUID() &&
|
||||
|
|
@ -8091,8 +8093,8 @@ void SpellAuraHolder::CleanupTriggeredSpells()
|
|||
|
||||
// needed for spell 43680, maybe others
|
||||
// TODO: is there a spell flag, which can solve this in a more sophisticated way?
|
||||
if(m_spellProto->EffectApplyAuraName[i] == SPELL_AURA_PERIODIC_TRIGGER_SPELL &&
|
||||
GetSpellDuration(m_spellProto) == m_spellProto->EffectAmplitude[i])
|
||||
if (m_spellProto->EffectApplyAuraName[i] == SPELL_AURA_PERIODIC_TRIGGER_SPELL &&
|
||||
GetSpellDuration(m_spellProto) == int32(m_spellProto->EffectAmplitude[i]))
|
||||
continue;
|
||||
|
||||
m_target->RemoveAurasDueToSpell(tSpellId);
|
||||
|
|
@ -8313,7 +8315,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply)
|
|||
// Ice Barrier (non stacking from one caster)
|
||||
if (m_spellProto->SpellIconID == 32)
|
||||
{
|
||||
if (!apply && m_removeMode == AURA_REMOVE_BY_DISPEL || m_removeMode == AURA_REMOVE_BY_SHIELD_BREAK)
|
||||
if ((!apply && m_removeMode == AURA_REMOVE_BY_DISPEL) || m_removeMode == AURA_REMOVE_BY_SHIELD_BREAK)
|
||||
{
|
||||
Unit::AuraList const& dummyAuras = m_target->GetAurasByType(SPELL_AURA_DUMMY);
|
||||
for(Unit::AuraList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr)
|
||||
|
|
@ -8449,7 +8451,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply)
|
|||
case SPELLFAMILY_PRIEST:
|
||||
{
|
||||
// Shadow Word: Pain (need visual check fro skip improvement talent) or Vampiric Touch
|
||||
if (m_spellProto->SpellIconID == 234 && m_spellProto->SpellVisual[0] || m_spellProto->SpellIconID == 2213)
|
||||
if ((m_spellProto->SpellIconID == 234 && m_spellProto->SpellVisual[0]) || m_spellProto->SpellIconID == 2213)
|
||||
{
|
||||
if (!apply && m_removeMode == AURA_REMOVE_BY_DISPEL)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue