aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTrazom62 <none@none>2010-01-12 21:16:12 +0100
committerTrazom62 <none@none>2010-01-12 21:16:12 +0100
commit445a603bef1223e5496eb0ce4697505cb108aa47 (patch)
tree4f642e5ea637e286c2f7280dcbb05d606e6b5fe9 /src
parent6cf82048a5345cab9fb20930268fce7e64b2fdc1 (diff)
Fix ACTION_T_RANDOM_PHASE_RANGE. Thanks Nayre and raczman
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/CreatureEventAI.cpp6
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:
{