Fix ACTION_T_RANDOM_PHASE_RANGE. Thanks Nayre and raczman

--HG--
branch : trunk
This commit is contained in:
Trazom62
2010-01-12 21:16:12 +01:00
parent 6cf82048a5
commit 445a603bef

View File

@@ -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:
{