mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[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:
parent
5020fcd3f1
commit
78dd259c38
9 changed files with 17 additions and 30 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue