diff options
Diffstat (limited to 'src/game/CreatureEventAI.cpp')
| -rw-r--r-- | src/game/CreatureEventAI.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index ece126b4011..e3fc574d697 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -651,10 +651,10 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 Phase = GetRandActionParam(rnd, action.random_phase.phase1, action.random_phase.phase2, action.random_phase.phase3); break; case ACTION_T_RANDOM_PHASE_RANGE: - if (action.random_phase_range.phaseMax > action.random_phase_range.phaseMin) - Phase = action.random_phase_range.phaseMin + (rnd % (action.random_phase_range.phaseMax - action.random_phase_range.phaseMin)); + if (action.random_phase_range.phaseMin <= action.random_phase_range.phaseMax) + Phase = urand(action.random_phase_range.phaseMin, action.random_phase_range.phaseMax); else - sLog.outErrorDb( "CreatureEventAI: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 <= Param1. Divide by Zero. Event = %d. CreatureEntry = %d", EventId, m_creature->GetEntry()); + sLog.outErrorDb( "CreatureEventAI: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 < Param1. Event = %d. CreatureEntry = %d", EventId, m_creature->GetEntry()); break; case ACTION_T_SUMMON_ID: { |
