Core/Misc: fixed another bunch of GCC warnings

This commit is contained in:
Ovahlord committed 2023-07-08 21:33:08 +02:00
1 parent 3de1f9a104
commit b489a905e1
10 files changed
+54 -62

No files matched your search

+38 -42
View File
@@ -557,53 +557,49 @@ public:
for (auto const& questTemplatePair : questTemplates)
{
uint8 localeIndex = handler->GetSessionDbLocaleIndex();
if (localeIndex >= 0)
if (QuestLocale const* questLocale = sObjectMgr->GetQuestLocale(questTemplatePair.first))
{
uint8 ulocaleIndex = uint8(localeIndex);
if (QuestLocale const* questLocale = sObjectMgr->GetQuestLocale(questTemplatePair.first))
if (questLocale->Title.size() > localeIndex && !questLocale->Title[localeIndex].empty())
{
if (questLocale->Title.size() > ulocaleIndex && !questLocale->Title[ulocaleIndex].empty())
std::string const& title = questLocale->Title[localeIndex];
if (Utf8FitTo(title, wNamePart))
{
std::string const& title = questLocale->Title[ulocaleIndex];
if (Utf8FitTo(title, wNamePart))
if (maxResults && count++ == maxResults)
{
if (maxResults && count++ == maxResults)
{
handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
return true;
}
char const* statusStr = "";
if (target)
{
switch (target->GetQuestStatus(questTemplatePair.first))
{
case QUEST_STATUS_COMPLETE:
statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_COMPLETE);
break;
case QUEST_STATUS_INCOMPLETE:
statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_ACTIVE);
break;
case QUEST_STATUS_REWARDED:
statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_REWARDED);
break;
default:
break;
}
}
if (handler->GetSession())
handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, questTemplatePair.first, questTemplatePair.first, questTemplatePair.second.GetQuestLevel(), title.c_str(), statusStr);
else
handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, questTemplatePair.first, title.c_str(), statusStr);
if (!found)
found = true;
continue;
handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
return true;
}
char const* statusStr = "";
if (target)
{
switch (target->GetQuestStatus(questTemplatePair.first))
{
case QUEST_STATUS_COMPLETE:
statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_COMPLETE);
break;
case QUEST_STATUS_INCOMPLETE:
statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_ACTIVE);
break;
case QUEST_STATUS_REWARDED:
statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_REWARDED);
break;
default:
break;
}
}
if (handler->GetSession())
handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, questTemplatePair.first, questTemplatePair.first, questTemplatePair.second.GetQuestLevel(), title.c_str(), statusStr);
else
handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, questTemplatePair.first, title.c_str(), statusStr);
if (!found)
found = true;
continue;
}
}
}
@@ -353,9 +353,7 @@ public:
_preparingPulsesChecker = 0;
_arcaneOverloadGUID.Clear();
_lastHitByArcaneBarrageGUID.Clear();
for (ObjectGuid& guid : _surgeTargetGUID)
guid.Clear();
_surgeTargetGUID.fill(ObjectGuid::Empty);
_killSpamFilter = false;
_executingVortex = false;
_arcaneReinforcements = true;
@@ -949,7 +947,7 @@ public:
}
else if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL)
{
memset(_surgeTargetGUID, 0, sizeof(_surgeTargetGUID));
_surgeTargetGUID.fill(ObjectGuid::Empty);
DoCastAOE(SPELL_SURGE_OF_POWER_WARNING_SELECTOR_25, true);
}
@@ -993,7 +991,7 @@ public:
uint8 _preparingPulsesChecker; // In retail they use 2 preparing pulses with 7 sec CD, after they pass 2 seconds.
ObjectGuid _arcaneOverloadGUID; // Last Arcane Overload summoned to know to which should visual be cast to (the purple ball, not bubble).
ObjectGuid _lastHitByArcaneBarrageGUID; // Last hit player by Arcane Barrage, will be removed if targets > 1.
ObjectGuid _surgeTargetGUID[3]; // All these three are used to keep current tagets to which warning should be sent.
std::array<ObjectGuid, 3> _surgeTargetGUID; // All these three are used to keep current tagets to which warning should be sent.
bool _killSpamFilter; // Prevent text spamming on killed player by helping implement a CD.
bool _despawned; // Checks if boss pass through evade on reset.
@@ -217,7 +217,7 @@ public:
IsFinalForm = false;
NeedThreatReset = false;
EnrageUsed = false;
memset(InnderDemon, 0, sizeof(InnderDemon));
InnderDemon.fill(ObjectGuid::Empty);
InnerDemon_Count = 0;
}
@@ -238,7 +238,7 @@ public:
bool EnrageUsed;
float x, y, z;
ObjectGuid InnderDemon[5];
std::array<ObjectGuid, 5> InnderDemon;
uint32 InnerDemon_Count;
ObjectGuid Demon;
ObjectGuid SpellBinderGUID[3];
+1 -1
View File
@@ -703,7 +703,7 @@ class spell_dk_pestilence : public SpellScript
float donePct = aurOld->GetDonePct();
float critChance = aurOld->GetCritChance();
if (AuraEffect* aurEffOld = aurOld->GetEffect(EFFECT_0))
if (aurOld->GetEffect(EFFECT_0))
{
caster->CastSpell(hitUnit, SPELL_DK_BLOOD_PLAGUE, true); // Spread the disease to hitUnit.