mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[12128] Fix more warnings - close #4
* Remove warning: enumeration value '<value>' not handled in switch * Remove warning: enumeral and non-enumeral type in conditional expression * Remove warning: too many arguments for format Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
1707edbcfd
commit
6e76dbae3f
16 changed files with 43 additions and 16 deletions
|
|
@ -557,6 +557,7 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(Unit* unit)
|
|||
{
|
||||
case ALLIANCE: houseid = player->GetAuctionAccessMode() == 0 ? 1 : 6; break;
|
||||
case HORDE: houseid = player->GetAuctionAccessMode() == 0 ? 6 : 1; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ namespace MaNGOS
|
|||
data << ObjectGuid(targetGuid);
|
||||
data << uint32(strlen(text) + 1);
|
||||
data << text;
|
||||
data << uint8(i_source ? i_source->GetChatTag() : CHAT_TAG_NONE);
|
||||
data << uint8(i_source ? i_source->GetChatTag() : uint8(CHAT_TAG_NONE));
|
||||
}
|
||||
|
||||
ChatMsg i_msgtype;
|
||||
|
|
@ -152,7 +152,7 @@ namespace MaNGOS
|
|||
data << ObjectGuid(targetGuid);
|
||||
data << uint32(strlen(str) + 1);
|
||||
data << str;
|
||||
data << uint8(i_source ? i_source->GetChatTag() : CHAT_TAG_NONE);
|
||||
data << uint8(i_source ? i_source->GetChatTag() : uint8(CHAT_TAG_NONE));
|
||||
}
|
||||
private:
|
||||
|
||||
|
|
|
|||
|
|
@ -574,7 +574,7 @@ void Channel::Say(ObjectGuid p, const char* what, uint32 lang)
|
|||
data << ObjectGuid(p);
|
||||
data << uint32(messageLength);
|
||||
data << what;
|
||||
data << uint8(plr ? plr->GetChatTag() : CHAT_TAG_NONE);
|
||||
data << uint8(plr ? plr->GetChatTag() : uint8(CHAT_TAG_NONE));
|
||||
|
||||
SendToAll(&data, !m_players[p].IsModerator() ? p : ObjectGuid());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -226,6 +226,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recv_data)
|
|||
{
|
||||
case ALLIANCE: disabled = mask & (1 << 0); break;
|
||||
case HORDE: disabled = mask & (1 << 1); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
if (disabled)
|
||||
|
|
|
|||
|
|
@ -434,6 +434,8 @@ void GameObject::Update(uint32 update_diff, uint32 p_time)
|
|||
m_UniqueUsers.clear();
|
||||
SetLootState(GO_READY);
|
||||
return; // SetLootState and return because go is treated as "burning flag" due to GetGoAnimProgress() being 100 and would be removed on the client
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!HasStaticDBSpawnData()) // Remove wild summoned after use
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ BattleGroundMap* MapManager::CreateBattleGroundMap(uint32 id, uint32 InstanceId,
|
|||
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), bg->GetMinLevel());
|
||||
|
||||
uint8 spawnMode = bracketEntry ? bracketEntry->difficulty : REGULAR_DIFFICULTY;
|
||||
uint8 spawnMode = bracketEntry ? bracketEntry->difficulty : uint8(REGULAR_DIFFICULTY);
|
||||
|
||||
BattleGroundMap* map = new BattleGroundMap(id, i_gridCleanUpDelay, InstanceId, spawnMode);
|
||||
MANGOS_ASSERT(map->IsBattleGroundOrArena());
|
||||
|
|
|
|||
|
|
@ -875,6 +875,11 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner)
|
|||
// this enables popup window (pet abandon, cancel)
|
||||
SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
||||
break;
|
||||
case GUARDIAN_PET:
|
||||
case MINI_PET:
|
||||
case PROTECTOR_PET:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
SetLevel(petlevel);
|
||||
|
|
|
|||
|
|
@ -163,6 +163,7 @@ void PlayerTaxi::InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint32 leve
|
|||
{
|
||||
case ALLIANCE: SetTaximaskNode(100); break;
|
||||
case HORDE: SetTaximaskNode(99); break;
|
||||
default: break;
|
||||
}
|
||||
// level dependent taxi hubs
|
||||
if (level >= 68)
|
||||
|
|
@ -2386,7 +2387,7 @@ void Player::SetGameMaster(bool on)
|
|||
|
||||
// restore phase
|
||||
AuraList const& phases = GetAurasByType(SPELL_AURA_PHASE);
|
||||
SetPhaseMask(!phases.empty() ? phases.front()->GetMiscValue() : PHASEMASK_NORMAL, false);
|
||||
SetPhaseMask(!phases.empty() ? phases.front()->GetMiscValue() : uint32(PHASEMASK_NORMAL), false);
|
||||
|
||||
CallForAllControlledUnits(SetGameMasterOffHelper(getFaction()), CONTROLLED_PET | CONTROLLED_TOTEMS | CONTROLLED_GUARDIANS | CONTROLLED_CHARM);
|
||||
|
||||
|
|
@ -10795,7 +10796,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16& dest, Item* pItem, bool
|
|||
return EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE;
|
||||
|
||||
// if swap ignore item (equipped also)
|
||||
if (InventoryResult res2 = CanEquipUniqueItem(pItem, swap ? eslot : NULL_SLOT))
|
||||
if (InventoryResult res2 = CanEquipUniqueItem(pItem, swap ? eslot : uint8(NULL_SLOT)))
|
||||
return res2;
|
||||
|
||||
// check unique-equipped special item classes
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recv_data)
|
|||
|
||||
if (reward >= QUEST_REWARD_CHOICES_COUNT)
|
||||
{
|
||||
sLog.outError("Error in CMSG_QUESTGIVER_CHOOSE_REWARD - %s tried to get invalid reward (%u) (probably packet hacking)", _player->GetGuidStr().c_str(), _player->GetGUIDLow(), reward);
|
||||
sLog.outError("Error in CMSG_QUESTGIVER_CHOOSE_REWARD - %s tried to get invalid reward (%u) (probably packet hacking)", _player->GetGuidStr().c_str(), reward);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1181,7 +1181,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
|||
// Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
|
||||
if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
|
||||
{
|
||||
caster->ProcDamageAndSpell(unitTarget, real_caster ? procAttacker : PROC_FLAG_NONE, procVictim, procEx, addhealth, m_attackType, m_spellInfo);
|
||||
caster->ProcDamageAndSpell(unitTarget, real_caster ? procAttacker : uint32(PROC_FLAG_NONE), procVictim, procEx, addhealth, m_attackType, m_spellInfo);
|
||||
}
|
||||
|
||||
int32 gain = caster->DealHeal(unitTarget, addhealth, m_spellInfo, crit, absorb);
|
||||
|
|
@ -1216,7 +1216,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
|||
|
||||
// Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
|
||||
if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
|
||||
caster->ProcDamageAndSpell(unitTarget, real_caster ? procAttacker : PROC_FLAG_NONE, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo);
|
||||
caster->ProcDamageAndSpell(unitTarget, real_caster ? procAttacker : uint32(PROC_FLAG_NONE), procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo);
|
||||
|
||||
// trigger weapon enchants for weapon based spells; exclude spells that stop attack, because may break CC
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->GetEquippedItemClass() == ITEM_CLASS_WEAPON &&
|
||||
|
|
@ -1261,7 +1261,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
|||
procEx = createProcExtendMask(&damageInfo, missInfo);
|
||||
// Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
|
||||
if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
|
||||
caster->ProcDamageAndSpell(unit, real_caster ? procAttacker : PROC_FLAG_NONE, procVictim, procEx, 0, m_attackType, m_spellInfo);
|
||||
caster->ProcDamageAndSpell(unit, real_caster ? procAttacker : uint32(PROC_FLAG_NONE), procVictim, procEx, 0, m_attackType, m_spellInfo);
|
||||
}
|
||||
|
||||
// Call scripted function for AI if this spell is casted upon a creature
|
||||
|
|
|
|||
|
|
@ -6712,6 +6712,16 @@ void Aura::HandleShapeshiftBoosts(bool apply)
|
|||
case FORM_STEALTH:
|
||||
case FORM_CREATURECAT:
|
||||
case FORM_CREATUREBEAR:
|
||||
case FORM_STEVES_GHOUL:
|
||||
case FORM_THARONJA_SKELETON:
|
||||
case FORM_TEST_OF_STRENGTH:
|
||||
case FORM_BLB_PLAYER:
|
||||
case FORM_SHADOW_DANCE:
|
||||
case FORM_TEST:
|
||||
case FORM_ZOMBIE:
|
||||
case FORM_UNDEAD:
|
||||
case FORM_FRENZY:
|
||||
case FORM_NONE:
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -8649,7 +8659,7 @@ void Aura::HandlePhase(bool apply, bool Real)
|
|||
target->RemoveAurasDueToSpell(phases.front()->GetId(), GetHolder());
|
||||
}
|
||||
|
||||
target->SetPhaseMask(apply ? GetMiscValue() : PHASEMASK_NORMAL, true);
|
||||
target->SetPhaseMask(apply ? GetMiscValue() : uint32(PHASEMASK_NORMAL), true);
|
||||
// no-phase is also phase state so same code for apply and remove
|
||||
if (GetEffIndex() == EFFECT_INDEX_0 && target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7962,6 +7962,12 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
|
|||
unitTarget->CastSpell(unitTarget, 59815, true);
|
||||
break;
|
||||
}
|
||||
// These are not restored
|
||||
case POWER_FOCUS:
|
||||
case POWER_HAPPINESS:
|
||||
case POWER_RUNE:
|
||||
case POWER_HEALTH:
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3746,7 +3746,7 @@ uint32 Unit::GetWeaponSkillValue(WeaponAttackType attType, Unit const* target) c
|
|||
return GetMaxSkillValueForLevel(); // always maximized SKILL_FERAL_COMBAT in fact
|
||||
|
||||
// weapon skill or (unarmed for base attack)
|
||||
uint32 skill = item ? item->GetSkill() : SKILL_UNARMED;
|
||||
uint32 skill = item ? item->GetSkill() : uint32(SKILL_UNARMED);
|
||||
|
||||
// in PvP use full skill instead current skill value
|
||||
value = (target && target->GetTypeId() == TYPEID_PLAYER)
|
||||
|
|
@ -7633,7 +7633,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* pVictim, uint32 pdamage, WeaponAttackTyp
|
|||
bool isWeaponDamageBasedSpell = !(spellProto && (damagetype == DOT || IsSpellHaveEffect(spellProto, SPELL_EFFECT_SCHOOL_DAMAGE)));
|
||||
Item* pWeapon = GetTypeId() == TYPEID_PLAYER ? ((Player*)this)->GetWeaponForAttack(attType, true, false) : NULL;
|
||||
uint32 creatureTypeMask = pVictim->GetCreatureTypeMask();
|
||||
uint32 schoolMask = spellProto ? spellProto->SchoolMask : GetMeleeDamageSchoolMask();
|
||||
uint32 schoolMask = spellProto ? spellProto->SchoolMask : uint32(GetMeleeDamageSchoolMask());
|
||||
|
||||
// FLAT damage bonus auras
|
||||
// =======================
|
||||
|
|
@ -7888,7 +7888,7 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* pCaster, uint32 pdamage, WeaponAttackTy
|
|||
|
||||
// differentiate for weapon damage based spells
|
||||
bool isWeaponDamageBasedSpell = !(spellProto && (damagetype == DOT || IsSpellHaveEffect(spellProto, SPELL_EFFECT_SCHOOL_DAMAGE)));
|
||||
uint32 schoolMask = spellProto ? spellProto->SchoolMask : GetMeleeDamageSchoolMask();
|
||||
uint32 schoolMask = spellProto ? spellProto->SchoolMask : uint32(GetMeleeDamageSchoolMask());
|
||||
uint32 mechanicMask = spellProto ? GetAllSpellMechanicMask(spellProto) : 0;
|
||||
|
||||
// Shred also have bonus as MECHANIC_BLEED damages
|
||||
|
|
|
|||
|
|
@ -957,7 +957,7 @@ void World::SetInitialWorldSettings()
|
|||
// No SQL injection as values are treated as integers
|
||||
|
||||
// not send custom type REALM_FFA_PVP to realm list
|
||||
uint32 server_type = IsFFAPvPRealm() ? REALM_TYPE_PVP : getConfig(CONFIG_UINT32_GAME_TYPE);
|
||||
uint32 server_type = IsFFAPvPRealm() ? uint32(REALM_TYPE_PVP) : getConfig(CONFIG_UINT32_GAME_TYPE);
|
||||
uint32 realm_zone = getConfig(CONFIG_UINT32_REALM_ZONE);
|
||||
LoginDatabase.PExecute("UPDATE realmlist SET icon = %u, timezone = %u WHERE id = '%u'", server_type, realm_zone, realmID);
|
||||
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ void SqlPlainPreparedStatement::DataToString(const SqlStmtFieldData& data, std::
|
|||
m_pConn.DB().escape_string(tmp);
|
||||
fmt << "'" << tmp << "'";
|
||||
}
|
||||
case FIELD_NONE: break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "12127"
|
||||
#define REVISION_NR "12128"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue