Skip to content

Commit

Permalink
fix(Scripts/BlackTemple): Illidan buffer overflow (#21441)
Browse files Browse the repository at this point in the history
  • Loading branch information
sogladev authored Feb 14, 2025
1 parent 062f9c4 commit 9412c1e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ struct boss_illidan_stormrage : public BossAI
_canTalk = true;
_dying = false;
_inCutscene = false;
beamPosId = urand(0, MAX_EYE_BEAM_POS);
beamPosId = urand(0, MAX_EYE_BEAM_POS - 1);
me->ReplaceAllUnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
me->SetDisableGravity(false);
me->SetHover(false);
Expand Down Expand Up @@ -696,11 +696,11 @@ struct boss_illidan_stormrage : public BossAI

void CycleBeamPos(uint8 &beamPosId)
{
uint8 _incumbentBeamPos = urand(0, MAX_EYE_BEAM_POS);
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 9412c1e

Please # to comment.