Fix ACTION_T_RANDOM_PHASE_RANGE. Thanks Nayre and raczman
--HG-- branch : trunk
This commit is contained in:
@@ -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);
|
Phase = GetRandActionParam(rnd, action.random_phase.phase1, action.random_phase.phase2, action.random_phase.phase3);
|
||||||
break;
|
break;
|
||||||
case ACTION_T_RANDOM_PHASE_RANGE:
|
case ACTION_T_RANDOM_PHASE_RANGE:
|
||||||
if (action.random_phase_range.phaseMax > action.random_phase_range.phaseMin)
|
if (action.random_phase_range.phaseMin <= action.random_phase_range.phaseMax)
|
||||||
Phase = action.random_phase_range.phaseMin + (rnd % (action.random_phase_range.phaseMax - action.random_phase_range.phaseMin));
|
Phase = urand(action.random_phase_range.phaseMin, action.random_phase_range.phaseMax);
|
||||||
else
|
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;
|
break;
|
||||||
case ACTION_T_SUMMON_ID:
|
case ACTION_T_SUMMON_ID:
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user