Core/Misc: fixed a bunch of GCC warnings

This commit is contained in:
Ovahlord committed 2022-03-21 21:32:41 +01:00
1 parent 9c88c6ea91
commit ca9f34574d
10 files changed
+24 -26

No files matched your search

+1 -1
View File
@@ -90,7 +90,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPackets::Quest::QuestGiverHe
// Stop the npc if moving
if (uint32 pause = creature->GetMovementTemplate().GetInteractionPauseTimer())
{
creature->PauseMovement(sWorld->getIntConfig(CONFIG_CREATURE_STOP_FOR_PLAYER));
creature->PauseMovement(pause);
creature->SetHomePosition(creature->GetPosition());
}
@@ -296,7 +296,7 @@ inline SpellSchools GetFirstSchoolInMask(SpellSchoolMask mask)
return SPELL_SCHOOL_NORMAL;
}
enum ItemQualities
enum ItemQualities : uint8
{
ITEM_QUALITY_POOR = 0, //GREY
ITEM_QUALITY_NORMAL = 1, //WHITE
@@ -66,8 +66,7 @@ void RandomMovementGenerator<Creature>::DoInitialize(Creature* owner)
_reference = owner->GetPosition();
owner->StopMoving();
if (_wanderDistance <= 0.1f)
_wanderDistance = std::max<float>(_wanderDistance = owner->GetRespawnRadius(), 0.1f);
_wanderDistance = std::max<float>(owner->GetRespawnRadius(), 0.1f);
// Retail seems to let a creature walk 2 up to 10 splines before triggering a pause
_wanderSteps = urand(2, 10);
@@ -337,9 +337,9 @@ WorldPacket const* WorldPackets::Auth::ConnectTo::Write()
HmacSha1 hmacHash(64, WherePacketHmac);
hmacHash.UpdateData(address, 16);
hmacHash.UpdateData((uint8* const)&addressType, 4);
hmacHash.UpdateData((uint8* const)&port, 2);
hmacHash.UpdateData((uint8* const)Haiku.c_str(), 73);
hmacHash.UpdateData(reinterpret_cast<uint8 const*>(&addressType), 4);
hmacHash.UpdateData(reinterpret_cast<uint8 const*>(&port), 2);
hmacHash.UpdateData(reinterpret_cast<uint8 const*>(Haiku.c_str()), 73);
hmacHash.UpdateData(PiDigits, 142);
hmacHash.UpdateData(&Payload.XorMagic, 1);
hmacHash.Finalize();
+3 -3
View File
@@ -513,7 +513,7 @@ void World::LoadConfigSettings(bool reload)
m_defaultDbcLocale = LocaleConstant(sConfigMgr->GetIntDefault("DBC.Locale", 0));
if (m_defaultDbcLocale >= TOTAL_LOCALES || m_defaultDbcLocale < LOCALE_enUS || m_defaultDbcLocale == LOCALE_NONE)
if (m_defaultDbcLocale >= TOTAL_LOCALES || m_defaultDbcLocale == LOCALE_NONE)
{
TC_LOG_ERROR("server.loading", "Incorrect DBC.Locale! Must be >= 0 and < %d and not %d (set to 0)", TOTAL_LOCALES, LOCALE_NONE);
m_defaultDbcLocale = LOCALE_enUS;
@@ -1258,9 +1258,9 @@ void World::LoadConfigSettings(bool reload)
m_bool_configs[CONFIG_BG_XP_FOR_KILL] = sConfigMgr->GetBoolDefault("Battleground.GiveXPForKills", false);
m_int_configs[CONFIG_RATED_BATTLEGROUND_ENABLE] = sConfigMgr->GetIntDefault ("RatedBattleground.Enable", 0);
if (m_int_configs[CONFIG_RATED_BATTLEGROUND_ENABLE] < 0 || m_int_configs[CONFIG_RATED_BATTLEGROUND_ENABLE] > 3)
if (m_int_configs[CONFIG_RATED_BATTLEGROUND_ENABLE] > 3)
{
TC_LOG_ERROR("server.loading", "RatedBattleground.Enable (%d) must be >= 0 and <= 3. Using 0 instead.", m_int_configs[CONFIG_RATED_BATTLEGROUND_ENABLE]);
TC_LOG_ERROR("server.loading", "RatedBattleground.Enable (%d) must be in a range between 0 and 3. Using 0 instead.", m_int_configs[CONFIG_RATED_BATTLEGROUND_ENABLE]);
m_int_configs[CONFIG_RATED_BATTLEGROUND_ENABLE] = 0;
}
m_int_configs[CONFIG_RATED_BATTLEGROUND_REWARD] = sConfigMgr->GetIntDefault ("RatedBattleground.Reward", 40000);
+1 -1
View File
@@ -1589,7 +1589,7 @@ public:
if (!name)
name = "Unknown item";
handler->PSendSysMessage(alternateString ? LANG_COMMAND_NPC_SHOWLOOT_ENTRY_2 : LANG_COMMAND_NPC_SHOWLOOT_ENTRY,
itemCount, ItemQualityColors[itemTemplate ? itemTemplate->GetQuality() : ITEM_QUALITY_POOR], itemId, name, itemId);
itemCount, ItemQualityColors[itemTemplate ? itemTemplate->GetQuality() : static_cast<uint8>(ITEM_QUALITY_POOR)], itemId, name, itemId);
}
static void _IterateNotNormalLootMap(ChatHandler* handler, NotNormalLootItemMap const& map, std::vector<LootItem> const& items)
{
@@ -490,8 +490,8 @@ struct npc_brazie_the_bonatist_vehicle : public VehicleAI
case EVENT_CREATE_GHOUL:
{
// The tutorial quest only spawns zombies in the center lane
uint8 index = _currentLevel == LEVEL_TUTORIAL ? CENTER_ZOMBIE_LANE_INDEX : urand(0, MAX_TARGET_POSITIONS - 1);
Position pos = SpitterTargetPositions[index];
uint8 index = _currentLevel == LEVEL_TUTORIAL ? static_cast<uint8>(CENTER_ZOMBIE_LANE_INDEX) : static_cast<uint8>(urand(0, MAX_TARGET_POSITIONS - 1));
Position const& pos = SpitterTargetPositions[index];
float angle = pos.GetAngle(GoalStalkerPositions[index]);
uint32 spellId = 0;
@@ -744,7 +744,7 @@ struct boss_ragnaros_firelands : public BossAI
events.Repeat(1min);
break;
case EVENT_ENGULFING_FLAMES:
DoCastAOE(IsHeroic() ? SPELL_WORLD_IN_FLAMES : SPELL_ENGULFING_FLAMES, CastSpellExtraArgs().AddSpellBP0(urand(0, 2)));
DoCastAOE(IsHeroic() ? SPELL_WORLD_IN_FLAMES : static_cast<uint32>(SPELL_ENGULFING_FLAMES), CastSpellExtraArgs().AddSpellBP0(urand(0, 2)));
Talk(IsHeroic() ? SAY_ANNOUNCE_WORLD_IN_FLAMES : SAY_ANNOUNCE_ENGULFING_FLAMES);
events.Repeat(events.IsInPhase(PHASE_TWO) ? 1min : 30s);
break;
+1 -1
View File
@@ -340,7 +340,7 @@ class spell_dru_eclipse_mastery_driver_passive : public AuraScript
target->CastSpell(target, SPELL_DRUID_EUPHORIA_MANA_ENERGIZE, CastSpellExtraArgs().AddSpellBP0(euphoria->GetAmount()));
// T11 Bonus
if (AuraEffect const* t11Bonus = target->GetAuraEffect(SPELL_DRUID_ITEM_T11_BALANCE_4P_BONUS, EFFECT_0))
if (target->GetAuraEffect(SPELL_DRUID_ITEM_T11_BALANCE_4P_BONUS, EFFECT_0))
target->CastSpell(target, SPELL_DRUID_ASTRAL_ALIGNMENT, CastSpellExtraArgs().AddSpellMod(SPELLVALUE_AURA_STACK, 3));
}
+10 -11
View File
@@ -4522,19 +4522,18 @@ class spell_gen_blink : public SpellScriptLoader
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
Unit* caster = GetCaster();
if (!caster || !caster->IsCreature())
return;
Creature* creature = caster->ToCreature();
if (Unit* target = creature->GetThreatManager().GetCurrentVictim())
{
if (Creature* caster = GetCaster()->ToCreature())
creature->GetThreatManager().ResetThreat(target);
if (creature->IsAIEnabled())
{
if (Unit* target = caster->GetThreatManager().GetCurrentVictim())
{
caster->GetThreatManager().ResetThreat(target);
if (caster->IsAIEnabled())
{
caster->CastSpell(target, SPELL_BLINK_TARGET, true);
caster->AI()->AttackStart(target);
}
}
creature->CastSpell(target, SPELL_BLINK_TARGET, true);
creature->AI()->AttackStart(target);
}
}
}