[7672] Move ReceiveEmote from script API to AI API.

This is also fix triggering ReceiveEmote for EventAI broken at it move to mangos sources.
This commit is contained in:
VladimirMangos 2009-04-15 06:06:42 +04:00
parent 5020fcd3f1
commit 78dd259c38
9 changed files with 17 additions and 30 deletions

View file

@ -1629,19 +1629,17 @@ bool CreatureEventAI::CanCast(Unit* Target, SpellEntry const *Spell, bool Trigge
return true;
}
bool CreatureEventAI::ReceiveEmote(Player* pPlayer, Creature* pCreature, uint32 uiEmote)
void CreatureEventAI::ReceiveEmote(Player* pPlayer, uint32 text_emote)
{
CreatureEventAI* pTmpCreature = (CreatureEventAI*)(pCreature->AI());
if (bEmptyList)
return;
if (pTmpCreature->bEmptyList)
return true;
for (std::list<CreatureEventAIHolder>::iterator itr = pTmpCreature->CreatureEventAIList.begin(); itr != pTmpCreature->CreatureEventAIList.end(); ++itr)
for (std::list<CreatureEventAIHolder>::iterator itr = CreatureEventAIList.begin(); itr != CreatureEventAIList.end(); ++itr)
{
if ((*itr).Event.event_type == EVENT_T_RECEIVE_EMOTE)
{
if ((*itr).Event.event_param1 != uiEmote)
return true;
if ((*itr).Event.event_param1 != text_emote)
return;
bool bProcess = false;
@ -1696,10 +1694,8 @@ bool CreatureEventAI::ReceiveEmote(Player* pPlayer, Creature* pCreature, uint32
if (bProcess)
{
sLog.outDebug("CreatureEventAI: ReceiveEmote CreatureEventAI: Condition ok, processing");
pTmpCreature->ProcessEvent(*itr, pPlayer);
ProcessEvent(*itr, pPlayer);
}
}
}
return true;
}