aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/Player.cpp4
-rw-r--r--src/game/Wintergrasp.cpp6
2 files changed, 7 insertions, 3 deletions
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;
diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp
index 1e88b63912b..778214ceecb 100644
--- a/src/game/Wintergrasp.cpp
+++ b/src/game/Wintergrasp.cpp
@@ -865,18 +865,18 @@ void OPvPWintergrasp::HandleKill(Player *killer, Unit *victim)
{
if (victim->getLevel() >= 70)
ok = true;
- killer->RewardPlayerAndGroupAtEvent(CRE_PVP_KILL, 0);
+ killer->RewardPlayerAndGroupAtEvent(CRE_PVP_KILL, victim);
}
else
{
switch(GetCreatureType(victim->GetEntry()))
{
case CREATURE_SIEGE_VEHICLE:
- killer->RewardPlayerAndGroupAtEvent(CRE_PVP_KILL_V,0);
+ killer->RewardPlayerAndGroupAtEvent(CRE_PVP_KILL_V, victim);
ok = true;
break;
case CREATURE_GUARD:
- killer->RewardPlayerAndGroupAtEvent(CRE_PVP_KILL, 0);
+ killer->RewardPlayerAndGroupAtEvent(CRE_PVP_KILL, victim);
ok = true;
break;
case CREATURE_TURRET: