From 5e9c0d385ac862d11b0a1a6d894dce4ac172d39b Mon Sep 17 00:00:00 2001 From: tartalo Date: Wed, 21 Oct 2009 22:15:36 +0200 Subject: * Fix possible server crash in Player::IsAtGroupRewardDistance, by Spp * Fix possible server crash in Player::RewardPlayerAndGroupAtEvent * Wintergrasp: Correct use of RewardPlayerAndGroupAtEvent, by Spp --HG-- branch : trunk --- src/game/Player.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/game/Player.cpp') diff --git a/src/game/Player.cpp b/src/game/Player.cpp index b2b87349cca..18ffff3a0b2 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -20289,6 +20289,8 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim) void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource) { + if (!pRewardSource) + return; uint64 creature_guid = (pRewardSource && pRewardSource->GetTypeId()==TYPEID_UNIT) ? pRewardSource->GetGUID() : uint64(0); // prepare data for near group iteration @@ -20314,6 +20316,8 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const { + if (!pRewardSource) + return; const WorldObject* player = GetCorpse(); if(!player || isAlive()) player = this; -- cgit v1.2.3