From 79c1b5942c00636485c035c7b0b5b2d9de7d3d65 Mon Sep 17 00:00:00 2001 From: SnapperRy Date: Thu, 6 Oct 2016 11:14:36 +0200 Subject: Revert "Core/Creature: don't give kill and achievement credit if a creature kills itself." Causes an issue where a creature killed by a reflected spell will not give credits. Thanks Aokromes for noticing. Reverting this until a better solution is found. This reverts commit 5417a1a37f28d2746e83a7423f82abc46e2b4a4a. --- src/server/game/Entities/Unit/Unit.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 07d4413565f..4dcb9a505ea 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11642,9 +11642,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) } } - // Don't give kill credit if creature killed itself - if (this != victim) - player->RewardPlayerAndGroupAtKill(victim, false); + player->RewardPlayerAndGroupAtKill(victim, false); } // Do KILL and KILLED procs. KILL proc is called only for the unit who landed the killing blow (and its owner - for pets and totems) regardless of who tapped the victim @@ -11661,11 +11659,10 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) // Proc auras on death - must be before aura/combat remove victim->ProcSkillsAndAuras(victim, PROC_FLAG_NONE, PROC_FLAG_DEATH, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_NONE, PROC_HIT_NONE, nullptr, nullptr, nullptr); - // update get killing blow achievements (only if creature did not kill itself), must be done before setDeathState to be able to require auras on target + // update get killing blow achievements, must be done before setDeathState to be able to require auras on target // and before Spirit of Redemption as it also removes auras - if (this != victim) - if (Player* killerPlayer = GetCharmerOrOwnerPlayerOrPlayerItself()) - killerPlayer->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, 1, 0, victim); + if (Player* killerPlayer = GetCharmerOrOwnerPlayerOrPlayerItself()) + killerPlayer->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, 1, 0, victim); // if talent known but not triggered (check priest class for speedup check) bool spiritOfRedemption = false; -- cgit v1.2.3