aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiscover- <amort11@hotmail.com>2012-07-02 17:33:17 +0200
committerDiscover- <amort11@hotmail.com>2012-07-02 17:33:17 +0200
commitf454b6722ca0d4be7c8a35730aa325d9404f0b72 (patch)
treebcbf1a0d2f10bac39f29370eb46e244ca41335b7
parent798fc2df4016c29441af6666a1b446c57cf81a68 (diff)
Core/Battlegrounds: Don't reward killing blows if the killer is also the victim. Reason could be stuff like warlock's Hellfire spell or fall damage.
-rwxr-xr-xsrc/server/game/Battlegrounds/Battleground.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 85bbd2f3b89..8b072bb32e4 100755
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -1769,12 +1769,16 @@ void Battleground::HandleTriggerBuff(uint64 go_guid)
SpawnBGObject(index, BUFF_RESPAWN_TIME);
}
-void Battleground::HandleKillPlayer(Player* player, Player* killer)
+void Battleground::HandleKillPlayer(Player* victim, Player* killer)
{
// Keep in mind that for arena this will have to be changed a bit
+ // Don't reward credit for killing ourselves, like fall damage of hellfire (warlock)
+ if (victim && killer && killer == victim)
+ return;
+
// Add +1 deaths
- UpdatePlayerScore(player, SCORE_DEATHS, 1);
+ UpdatePlayerScore(victim, SCORE_DEATHS, 1);
// Add +1 kills to group and +1 killing_blows to killer
if (killer)
{
@@ -1787,7 +1791,7 @@ void Battleground::HandleKillPlayer(Player* player, Player* killer)
if (!creditedPlayer || creditedPlayer == killer)
continue;
- if (creditedPlayer->GetTeam() == killer->GetTeam() && creditedPlayer->IsAtGroupRewardDistance(player))
+ if (creditedPlayer->GetTeam() == killer->GetTeam() && creditedPlayer->IsAtGroupRewardDistance(victim))
UpdatePlayerScore(creditedPlayer, SCORE_HONORABLE_KILLS, 1);
}
}
@@ -1795,8 +1799,8 @@ void Battleground::HandleKillPlayer(Player* player, Player* killer)
if (!isArena())
{
// To be able to remove insignia -- ONLY IN Battlegrounds
- player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
- RewardXPAtKill(killer, player);
+ victim->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
+ RewardXPAtKill(killer, victim);
}
}