aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 4dcb9a505ea..07d4413565f 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -11642,7 +11642,9 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
}
}
- player->RewardPlayerAndGroupAtKill(victim, false);
+ // Don't give kill credit if creature killed itself
+ if (this != victim)
+ 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
@@ -11659,10 +11661,11 @@ 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, must be done before setDeathState to be able to require auras on target
+ // 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
// and before Spirit of Redemption as it also removes auras
- if (Player* killerPlayer = GetCharmerOrOwnerPlayerOrPlayerItself())
- killerPlayer->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, 1, 0, victim);
+ if (this != 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;