Skip to content

Commit

Permalink
Resolve compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Jul 28, 2024
1 parent 26c4d69 commit eefe216
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/game/AI/EventAI/CreatureEventAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1630,7 +1630,7 @@ void CreatureEventAI::OnVehicleRide(Unit* vehicle, bool boarded, uint8 seat)
IncreaseDepthIfNecessary();
for (auto& i : m_CreatureEventAIList)
if (i.event.event_type == EVENT_T_BOARD_VEHICLE)
if (i.event.boardVehicle.board == boarded || i.event.boardVehicle.board == 2)
if (bool(i.event.boardVehicle.board) == boarded || i.event.boardVehicle.board == 2)
if (i.event.boardVehicle.seat == seat || i.event.boardVehicle.seat == -1)
CheckAndReadyEventForExecution(i, vehicle);
ProcessEvents(vehicle);
Expand All @@ -1641,7 +1641,7 @@ void CreatureEventAI::OnPassengerRide(Unit* passenger, bool boarded, uint8 seat)
IncreaseDepthIfNecessary();
for (auto& i : m_CreatureEventAIList)
if (i.event.event_type == EVENT_T_PASSENGER_BOARDED)
if (i.event.passengerBoard.board == boarded || i.event.passengerBoard.board == 2)
if (bool(i.event.passengerBoard.board) == boarded || i.event.passengerBoard.board == 2)
if (i.event.passengerBoard.seat == seat || i.event.passengerBoard.seat == -1)
CheckAndReadyEventForExecution(i, passenger);
ProcessEvents(passenger);
Expand Down
2 changes: 1 addition & 1 deletion src/game/AI/ScriptDevAI/base/TimerAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ bool Timer::UpdateTimer(const uint32 diff, bool combat)
if (disabled)
return false;

if (combatSetting != TIMER_ALWAYS && combatSetting != combat)
if (combatSetting != TIMER_ALWAYS && bool(combatSetting) != combat)
return false;

if (timer <= diff)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ struct HatefulStrikePrimer : public SpellScript

auto const& threatList = spell->GetCaster()->getThreatManager().getThreatList();
uint32 i = 0;
for (auto itr = threatList.begin(); itr != threatList.end() && i < (spell->GetCaster()->GetMap()->IsRegularDifficulty() ? 2 : 3); ++itr, ++i)
for (auto itr = threatList.begin(); itr != threatList.end() && i < (spell->GetCaster()->GetMap()->IsRegularDifficulty() ? 2u : 3u); ++itr, ++i)
if ((*itr)->getTarget() == target)
return true;
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ struct IceBolt : public SpellScript
if (Unit* target = caster->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0, SPELL_ICEBOLT, SELECT_FLAG_PLAYER | SELECT_FLAG_NOT_AURA))
caster->CastSpell(target, SPELL_ICEBOLT, TRIGGERED_NONE);

if (boss_ai->m_iceboltCount >= (boss_ai->m_isRegularMode ? 2 : 3))
if (boss_ai->m_iceboltCount >= (boss_ai->m_isRegularMode ? 2u : 3u))
{
caster->CastSpell(nullptr, SPELL_FROST_BREATH, TRIGGERED_IGNORE_COOLDOWNS | TRIGGERED_IGNORE_GCD);
caster->CastSpell(nullptr, SPELL_FROST_BREATH_DUMMY, TRIGGERED_IGNORE_COOLDOWNS | TRIGGERED_IGNORE_CURRENT_CASTED_SPELL | TRIGGERED_IGNORE_GCD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1659,7 +1659,7 @@ struct HodirsProtectiveGaze : AuraScript
Player* player = dynamic_cast<Player*>(aura->GetTarget());
if (!player)
return;
if (player->GetHealth() > remainingDamage)
if (player->GetHealth() > uint32(remainingDamage))
return;
instance_ulduar* instance = dynamic_cast<instance_ulduar*>(player->GetMap()->GetInstanceData());
if (!instance)
Expand Down
2 changes: 1 addition & 1 deletion src/game/Entities/Creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ uint32 Creature::ChooseDisplayId(const CreatureInfo* cinfo, const CreatureData*
{
if (cinfo->DisplayId[i])
{
if (roll < cinfo->DisplayIdProbability[i])
if (roll < int32(cinfo->DisplayIdProbability[i]))
{
display_id = cinfo->DisplayId[i];
break;
Expand Down
4 changes: 2 additions & 2 deletions src/game/Entities/StatSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ bool Pet::UpdateStats(Stats stat)
// value = ((base_value * base_pct) + total_value) * total_pct
float value = GetTotalStatValue(stat);
if (GetUInt32Value(UNIT_CREATED_BY_SPELL) == 697 && m_glyphedStat)
value *= 1.2;
value *= 1.2f;

float oldValue = GetStat(stat);
SetStat(stat, int32(value));
Expand Down Expand Up @@ -1156,7 +1156,7 @@ void Pet::UpdateAttackPowerAndDamage(bool ranged)
// float attPowerMod = GetModifierValue(unitMod, TOTAL_VALUE);
float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;
if (GetUInt32Value(UNIT_CREATED_BY_SPELL) == 30146 && m_glyphedStat)
attPowerMultiplier *= 1.2;
attPowerMultiplier *= 1.2f;
attPowerMultiplier -= 1.0f;

// UNIT_FIELD_(RANGED)_ATTACK_POWER field
Expand Down

0 comments on commit eefe216

Please sign in to comment.