[10374] Fixes for EFLAG_RANDOM_ACTION

* Field limited to uint8 so use proper flag mask (0x20 now)
* Search of selected action code also fixed.
This commit is contained in:
VladimirMangos 2010-08-19 00:06:58 +04:00
parent a15b0916b6
commit 80cef02190
4 changed files with 18 additions and 14 deletions

View file

@ -372,9 +372,15 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
// find selected action, skipping not used
uint32 j = 0;
for (; idx; ++j)
for (; ; ++j)
{
if (pHolder.Event.action[j].type != ACTION_T_NONE)
{
if (!idx)
break;
--idx;
}
}
ProcessAction(pHolder.Event.action[j], rnd, pHolder.Event.event_id, pActionInvoker);
}