Gcc build: get rid of few warnings
This commit is contained in:
parent
23fa213f22
commit
321f7fb739
@ -204,6 +204,8 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, float x, float
|
||||
case GAMEOBJECT_TYPE_CHEST:
|
||||
RollIfMineralVein();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Used by Eluna
|
||||
|
@ -1940,6 +1940,7 @@ void Player::Regenerate(Powers power)
|
||||
case POWER_FOCUS:
|
||||
case POWER_HAPPINESS:
|
||||
case POWER_HEALTH:
|
||||
default:
|
||||
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 ||
|
||||
// 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
|
||||
pSkill->id == SKILL_LOCKPICKING && skillAbility->max_value == 0)
|
||||
(pSkill->id == SKILL_LOCKPICKING && skillAbility->max_value == 0))
|
||||
{
|
||||
switch (GetSkillRangeType(pSkill, skillAbility->racemask != 0))
|
||||
{
|
||||
|
@ -4407,9 +4407,21 @@ DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group)
|
||||
|
||||
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 (!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; }
|
||||
}
|
||||
else // This block will be removed
|
||||
@ -4417,44 +4429,35 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
|
||||
if (gender != GENDER_NONE)
|
||||
{
|
||||
// not in expected gender
|
||||
if (!player || gender != player->getGender())
|
||||
if (gender != player->getGender())
|
||||
{ return false; }
|
||||
}
|
||||
|
||||
if (raceMask)
|
||||
{
|
||||
// not in expected race
|
||||
if (!player || !(raceMask & player->getRaceMask()))
|
||||
if (!(raceMask & player->getRaceMask()))
|
||||
{ return false; }
|
||||
}
|
||||
|
||||
if (questStart)
|
||||
{
|
||||
// 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; }
|
||||
}
|
||||
|
||||
if (questEnd)
|
||||
{
|
||||
// not in expected forbidden quest state
|
||||
if (!player || player->GetQuestRewardStatus(questEnd))
|
||||
if (player->GetQuestRewardStatus(questEnd))
|
||||
{ return false; }
|
||||
}
|
||||
}
|
||||
|
||||
if (areaId)
|
||||
{
|
||||
// not in expected zone
|
||||
if (newZone != areaId && newArea != areaId)
|
||||
{ return false; }
|
||||
}
|
||||
|
||||
if (auraSpell)
|
||||
{
|
||||
// not have expected aura
|
||||
if (!player)
|
||||
{ return false; }
|
||||
if (auraSpell > 0)
|
||||
// have expected aura
|
||||
{ return player->HasAura(auraSpell); }
|
||||
|
@ -7269,7 +7269,7 @@ bool Unit::IsSecondChoiceTarget(Unit* pTarget, bool checkThreatArea)
|
||||
return
|
||||
pTarget->IsImmunedToDamage(GetMeleeDamageSchoolMask()) ||
|
||||
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_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);
|
||||
default: break; //MAX_POWERS and POWERS_ALL probably should not belong to the enum Powers to do not require the default: case
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -88,7 +88,7 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target)
|
||||
|
||||
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);
|
||||
|
||||
|
@ -643,6 +643,8 @@ void Group::FillPremadeLFG(ObjectGuid plrGuid, ClassRoles requiredRole, uint32&
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
playersProcessed.push_back(plrGuid);
|
||||
}
|
||||
@ -691,6 +693,8 @@ void Group::FillPremadeLFG(ObjectGuid plrGuid, ClassRoles requiredRole, uint32&
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
playersProcessed.push_back(plrGuid);
|
||||
|
@ -2027,7 +2027,7 @@ void ScriptMgr::LoadScriptBinding()
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -6437,14 +6437,14 @@ void Spell::FillRaidOrPartyTargets(UnitList& targetUnitMap, Unit* member, float
|
||||
if (Target && (raid || subgroup == Target->GetSubGroup())
|
||||
&& !m_caster->IsHostileTo(Target))
|
||||
{
|
||||
if (Target == m_caster && withcaster ||
|
||||
Target != m_caster && m_caster->IsWithinDistInMap(Target, radius))
|
||||
if ((Target == m_caster && withcaster) ||
|
||||
(Target != m_caster && m_caster->IsWithinDistInMap(Target, radius)))
|
||||
{ targetUnitMap.push_back(Target); }
|
||||
|
||||
if (withPets)
|
||||
if (Pet* pet = Target->GetPet())
|
||||
if (pet == m_caster && withcaster ||
|
||||
pet != m_caster && m_caster->IsWithinDistInMap(pet, radius))
|
||||
if ((pet == m_caster && withcaster) ||
|
||||
(pet != m_caster && m_caster->IsWithinDistInMap(pet, radius)))
|
||||
{ targetUnitMap.push_back(pet); }
|
||||
}
|
||||
}
|
||||
@ -6452,14 +6452,14 @@ void Spell::FillRaidOrPartyTargets(UnitList& targetUnitMap, Unit* member, float
|
||||
else
|
||||
{
|
||||
Unit* ownerOrSelf = pMember ? pMember : member->GetCharmerOrOwnerOrSelf();
|
||||
if (ownerOrSelf == m_caster && withcaster ||
|
||||
ownerOrSelf != m_caster && m_caster->IsWithinDistInMap(ownerOrSelf, radius))
|
||||
if ((ownerOrSelf == m_caster && withcaster) ||
|
||||
(ownerOrSelf != m_caster && m_caster->IsWithinDistInMap(ownerOrSelf, radius)))
|
||||
{ targetUnitMap.push_back(ownerOrSelf); }
|
||||
|
||||
if (withPets)
|
||||
if (Pet* pet = ownerOrSelf->GetPet())
|
||||
if (pet == m_caster && withcaster ||
|
||||
pet != m_caster && m_caster->IsWithinDistInMap(pet, radius))
|
||||
if ((pet == m_caster && withcaster) ||
|
||||
(pet != m_caster && m_caster->IsWithinDistInMap(pet, radius)))
|
||||
{ targetUnitMap.push_back(pet); }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user