diff options
author | megamage <none@none> | 2009-04-19 18:24:40 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-19 18:24:40 -0500 |
commit | d159e84325fd5544d7e5155726883aeeb4640d15 (patch) | |
tree | 0aa3bf8834cc667a0951553400d17654bcaa028e /src/game/CreatureEventAI.cpp | |
parent | f9befe1d3db1769c9cfeb6898504c95ca58c2316 (diff) |
[7689] Batter EventAI loading checks and fix one from possible crash cases. Author: NoFantasy
--HG--
branch : trunk
Diffstat (limited to 'src/game/CreatureEventAI.cpp')
-rw-r--r-- | src/game/CreatureEventAI.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index bcd3500cb68..2cc5d4f14cc 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -900,10 +900,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; |