mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
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);
|
||||
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:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user