Skip to content

Commit

Permalink
refactor: replace recursion with dowhile
Browse files Browse the repository at this point in the history
  • Loading branch information
sogladev committed Feb 14, 2025
1 parent b70c09e commit 0df7105
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,11 +696,11 @@ struct boss_illidan_stormrage : public BossAI

void CycleBeamPos(uint8 &beamPosId)
{
uint8 _incumbentBeamPos = urand(0, MAX_EYE_BEAM_POS - 1);
if (_incumbentBeamPos == beamPosId)
CycleBeamPos(beamPosId);
else
beamPosId = _incumbentBeamPos;
uint8 newPos;
do {
newPos = urand(0, MAX_EYE_BEAM_POS - 1);
} while (newPos == beamPosId);
beamPosId = newPos;
}
};

Expand Down

0 comments on commit 0df7105

Please # to comment.