Gcc build: get rid of few warnings

This commit is contained in:
Olion 2015-04-07 00:15:24 +03:00
parent 23fa213f22
commit 321f7fb739
8 changed files with 38 additions and 27 deletions

View File

@ -204,6 +204,8 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, float x, float
case GAMEOBJECT_TYPE_CHEST: case GAMEOBJECT_TYPE_CHEST:
RollIfMineralVein(); RollIfMineralVein();
break; break;
default:
break;
} }
// Used by Eluna // Used by Eluna

View File

@ -1940,6 +1940,7 @@ void Player::Regenerate(Powers power)
case POWER_FOCUS: case POWER_FOCUS:
case POWER_HAPPINESS: case POWER_HAPPINESS:
case POWER_HEALTH: case POWER_HEALTH:
default:
break; break;
} }
@ -3055,9 +3056,9 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
if (skillAbility->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL || if (skillAbility->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL ||
// poison special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL // poison special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
pSkill->id == SKILL_POISONS && skillAbility->max_value == 0 || (pSkill->id == SKILL_POISONS && skillAbility->max_value == 0) ||
// lockpicking special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL // lockpicking special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
pSkill->id == SKILL_LOCKPICKING && skillAbility->max_value == 0) (pSkill->id == SKILL_LOCKPICKING && skillAbility->max_value == 0))
{ {
switch (GetSkillRangeType(pSkill, skillAbility->racemask != 0)) switch (GetSkillRangeType(pSkill, skillAbility->racemask != 0))
{ {

View File

@ -4407,9 +4407,21 @@ DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group)
bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 newArea) const bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 newArea) const
{ {
if (areaId)
{
// not in expected zone
if (newZone != areaId && newArea != areaId)
{
return false;
}
}
if (!player) //all following checks require valid player
return false;
if (conditionId) if (conditionId)
{ {
if (!player || !sObjectMgr.IsPlayerMeetToCondition(conditionId, player, player->GetMap(), NULL, CONDITION_FROM_SPELL_AREA)) if (!sObjectMgr.IsPlayerMeetToCondition(conditionId, player, player->GetMap(), NULL, CONDITION_FROM_SPELL_AREA))
{ return false; } { return false; }
} }
else // This block will be removed else // This block will be removed
@ -4417,44 +4429,35 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
if (gender != GENDER_NONE) if (gender != GENDER_NONE)
{ {
// not in expected gender // not in expected gender
if (!player || gender != player->getGender()) if (gender != player->getGender())
{ return false; } { return false; }
} }
if (raceMask) if (raceMask)
{ {
// not in expected race // not in expected race
if (!player || !(raceMask & player->getRaceMask())) if (!(raceMask & player->getRaceMask()))
{ return false; } { return false; }
} }
if (questStart) if (questStart)
{ {
// not in expected required quest state // not in expected required quest state
if (!player || (!questStartCanActive || !player->IsActiveQuest(questStart)) && !player->GetQuestRewardStatus(questStart)) if ((!questStartCanActive || !player->IsActiveQuest(questStart)) || player->GetQuestRewardStatus(questStart))
{ return false; } { return false; }
} }
if (questEnd) if (questEnd)
{ {
// not in expected forbidden quest state // not in expected forbidden quest state
if (!player || player->GetQuestRewardStatus(questEnd)) if (player->GetQuestRewardStatus(questEnd))
{ return false; } { return false; }
} }
} }
if (areaId)
{
// not in expected zone
if (newZone != areaId && newArea != areaId)
{ return false; }
}
if (auraSpell) if (auraSpell)
{ {
// not have expected aura // not have expected aura
if (!player)
{ return false; }
if (auraSpell > 0) if (auraSpell > 0)
// have expected aura // have expected aura
{ return player->HasAura(auraSpell); } { return player->HasAura(auraSpell); }

View File

@ -7269,7 +7269,7 @@ bool Unit::IsSecondChoiceTarget(Unit* pTarget, bool checkThreatArea)
return return
pTarget->IsImmunedToDamage(GetMeleeDamageSchoolMask()) || pTarget->IsImmunedToDamage(GetMeleeDamageSchoolMask()) ||
pTarget->hasNegativeAuraWithInterruptFlag(AURA_INTERRUPT_FLAG_DAMAGE) || pTarget->hasNegativeAuraWithInterruptFlag(AURA_INTERRUPT_FLAG_DAMAGE) ||
checkThreatArea && ((Creature*)this)->IsOutOfThreatArea(pTarget); (checkThreatArea && ((Creature*)this)->IsOutOfThreatArea(pTarget));
} }
//====================================================================== //======================================================================
@ -7969,6 +7969,7 @@ uint32 Unit::GetCreatePowers(Powers power) const
case POWER_FOCUS: return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->IsPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : POWER_FOCUS_DEFAULT); case POWER_FOCUS: return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->IsPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : POWER_FOCUS_DEFAULT);
case POWER_ENERGY: return POWER_ENERGY_DEFAULT; case POWER_ENERGY: return POWER_ENERGY_DEFAULT;
case POWER_HAPPINESS: return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->IsPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : POWER_HAPPINESS_DEFAULT); case POWER_HAPPINESS: return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->IsPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : POWER_HAPPINESS_DEFAULT);
default: break; //MAX_POWERS and POWERS_ALL probably should not belong to the enum Powers to do not require the default: case
} }
return 0; return 0;

View File

@ -88,7 +88,7 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target)
AddOnPacked.resize(AddonRealSize); // resize target for zlib action AddOnPacked.resize(AddonRealSize); // resize target for zlib action
if (!uncompress(const_cast<uint8*>(AddOnPacked.contents()), &AddonRealSize, const_cast<uint8*>((*Source).contents() + CurrentPosition), (*Source).size() - CurrentPosition) != Z_OK) if (uncompress(const_cast<uint8*>(AddOnPacked.contents()), &AddonRealSize, const_cast<uint8*>((*Source).contents() + CurrentPosition), (*Source).size() - CurrentPosition) == Z_OK)
{ {
Target->Initialize(SMSG_ADDON_INFO); Target->Initialize(SMSG_ADDON_INFO);

View File

@ -643,6 +643,8 @@ void Group::FillPremadeLFG(ObjectGuid plrGuid, ClassRoles requiredRole, uint32&
} }
break; break;
} }
default:
break;
} }
playersProcessed.push_back(plrGuid); playersProcessed.push_back(plrGuid);
} }
@ -691,6 +693,8 @@ void Group::FillPremadeLFG(ObjectGuid plrGuid, ClassRoles requiredRole, uint32&
} }
break; break;
} }
default:
break;
} }
playersProcessed.push_back(plrGuid); playersProcessed.push_back(plrGuid);

View File

@ -2027,7 +2027,7 @@ void ScriptMgr::LoadScriptBinding()
{ {
if (m_scriptBind[i].size()) //ignore missing script types to shorten the log if (m_scriptBind[i].size()) //ignore missing script types to shorten the log
{ {
sLog.outString(".. type %u: %u binds", i, m_scriptBind[i].size()); sLog.outString(".. type %u: %u binds", i, uint32(m_scriptBind[i].size()));
count -= m_scriptBind[i].size(); count -= m_scriptBind[i].size();
} }
} }

View File

@ -6437,14 +6437,14 @@ void Spell::FillRaidOrPartyTargets(UnitList& targetUnitMap, Unit* member, float
if (Target && (raid || subgroup == Target->GetSubGroup()) if (Target && (raid || subgroup == Target->GetSubGroup())
&& !m_caster->IsHostileTo(Target)) && !m_caster->IsHostileTo(Target))
{ {
if (Target == m_caster && withcaster || if ((Target == m_caster && withcaster) ||
Target != m_caster && m_caster->IsWithinDistInMap(Target, radius)) (Target != m_caster && m_caster->IsWithinDistInMap(Target, radius)))
{ targetUnitMap.push_back(Target); } { targetUnitMap.push_back(Target); }
if (withPets) if (withPets)
if (Pet* pet = Target->GetPet()) if (Pet* pet = Target->GetPet())
if (pet == m_caster && withcaster || if ((pet == m_caster && withcaster) ||
pet != m_caster && m_caster->IsWithinDistInMap(pet, radius)) (pet != m_caster && m_caster->IsWithinDistInMap(pet, radius)))
{ targetUnitMap.push_back(pet); } { targetUnitMap.push_back(pet); }
} }
} }
@ -6452,14 +6452,14 @@ void Spell::FillRaidOrPartyTargets(UnitList& targetUnitMap, Unit* member, float
else else
{ {
Unit* ownerOrSelf = pMember ? pMember : member->GetCharmerOrOwnerOrSelf(); Unit* ownerOrSelf = pMember ? pMember : member->GetCharmerOrOwnerOrSelf();
if (ownerOrSelf == m_caster && withcaster || if ((ownerOrSelf == m_caster && withcaster) ||
ownerOrSelf != m_caster && m_caster->IsWithinDistInMap(ownerOrSelf, radius)) (ownerOrSelf != m_caster && m_caster->IsWithinDistInMap(ownerOrSelf, radius)))
{ targetUnitMap.push_back(ownerOrSelf); } { targetUnitMap.push_back(ownerOrSelf); }
if (withPets) if (withPets)
if (Pet* pet = ownerOrSelf->GetPet()) if (Pet* pet = ownerOrSelf->GetPet())
if (pet == m_caster && withcaster || if ((pet == m_caster && withcaster) ||
pet != m_caster && m_caster->IsWithinDistInMap(pet, radius)) (pet != m_caster && m_caster->IsWithinDistInMap(pet, radius)))
{ targetUnitMap.push_back(pet); } { targetUnitMap.push_back(pet); }
} }
} }