[0063] Fix a bug with SCRIPT_COMMAND_KILL_CREDIT

This bug can happen if a (group) kill credit is provided without involved creature.
Thanks to Atari for pointing!
This commit is contained in:
Schmoozerd 2012-08-10 22:55:35 +02:00 committed by Antz
parent 27fefb1e96
commit aacb838e60
3 changed files with 10 additions and 3 deletions

View file

@ -21229,6 +21229,8 @@ void Player::RewardSinglePlayerAtKill(Unit* pVictim)
void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource)
{
MANGOS_ASSERT((!GetGroup() || pRewardSource) && "Player::RewardPlayerAndGroupAtEvent called for Group-Case but no source for range searching provided");
ObjectGuid creature_guid = pRewardSource && pRewardSource->GetTypeId() == TYPEID_UNIT ? pRewardSource->GetObjectGuid() : ObjectGuid();
// prepare data for near group iteration
@ -21241,7 +21243,7 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar
continue;
if (!pGroupGuy->IsAtGroupRewardDistance(pRewardSource))
continue; // member (alive or dead) or his corpse at req. distance
continue; // member (alive or dead) or his corpse at req. distance
// quest objectives updated only for alive group member or dead but with not released body
if (pGroupGuy->isAlive() || !pGroupGuy->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))