Skip to content

Commit

Permalink
npc_daphne_stilwellAI: remove superfluous checks.
Browse files Browse the repository at this point in the history
The member m_wave is an unsigned integer and those are always positive.
This also fixes a pair of GCC/clang 'warning: comparison is always false
due to limited range of data type [-Wtype-limits]' compiler warnings.
  • Loading branch information
evil-at-wow committed Oct 14, 2023
1 parent abf267b commit 3aa37e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/game/AI/ScriptDevAI/scripts/eastern_kingdoms/westfall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ struct npc_daphne_stilwellAI : public npc_escortAI

void DoSendWave()
{
if (m_wave < 0 || m_wave > 2)
if (m_wave > 2)
return;

++m_wave;
Expand Down Expand Up @@ -216,7 +216,7 @@ struct npc_daphne_stilwellAI : public npc_escortAI
if (summoned->GetEntry() != NPC_DEFIAS_RAIDER || motionType != POINT_MOTION_TYPE) // sanity check
return;

if (data >= 0 && data <= 4)
if (data <= 4)
{
uint8 secondWpOffset = 10;
summoned->GetMotionMaster()->MovePoint(5, RaiderCoords[secondWpOffset + data][0], RaiderCoords[secondWpOffset + data][1], RaiderCoords[secondWpOffset + data][2]);
Expand Down

0 comments on commit 3aa37e3

Please sign in to comment.