Skip to content

Commit

Permalink
Very minor refactor of Creature::HasSpell (vmangos#2322)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamemechanicwow authored Dec 1, 2023
1 parent 91ab2c1 commit 9d7cf55
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/game/Objects/Creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3062,11 +3062,10 @@ bool Creature::IsInEvadeMode() const

bool Creature::HasSpell(uint32 spellId) const
{
uint8 i;
for (i = 0; i < CREATURE_MAX_SPELLS; ++i)
for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i)
if (spellId == m_spells[i])
break;
return i < CREATURE_MAX_SPELLS; // break before end of iteration of known spells
return true;
return false;
}

void Creature::LockOutSpells(SpellSchoolMask schoolMask, uint32 duration)
Expand Down

0 comments on commit 9d7cf55

Please sign in to comment.