mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[7689] Batter EventAI loading checks and fix one from possible crash cases.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
f4adf83cd7
commit
ee9ea143d1
5 changed files with 40 additions and 15 deletions
|
|
@ -910,10 +910,11 @@ void CreatureEventAI::ProcessAction(uint16 type, uint32 param1, uint32 param2, u
|
|||
else
|
||||
{
|
||||
//if not available, use pActionInvoker
|
||||
Unit* pTarget = GetTargetByType(param2, pActionInvoker);
|
||||
|
||||
if (Player* pPlayer = pTarget->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
pPlayer->RewardPlayerAndGroupAtEvent(param1, m_creature);
|
||||
if (Unit* pTarget = GetTargetByType(param2, pActionInvoker))
|
||||
{
|
||||
if (Player* pPlayer = pTarget->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
pPlayer->RewardPlayerAndGroupAtEvent(param1, m_creature);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue