server: fix kill source for buff deaths without origin

This commit is contained in:
Xiretza 2023-08-29 16:54:56 +00:00
parent 06111612a3
commit 60538e0664

View File

@ -190,8 +190,12 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, last_change: Healt
get_attacker_name(KillType::Explosion, by)
},
(Some(DamageSource::Energy), Some(by)) => get_attacker_name(KillType::Energy, by),
(Some(DamageSource::Buff(buff_kind)), Some(by)) => {
get_attacker_name(KillType::Buff(buff_kind), by)
(Some(DamageSource::Buff(buff_kind)), by) => {
if let Some(by) = by {
get_attacker_name(KillType::Buff(buff_kind), by)
} else {
KillSource::NonExistent(KillType::Buff(buff_kind))
}
},
(Some(DamageSource::Other), Some(by)) => get_attacker_name(KillType::Other, by),
(Some(DamageSource::Falling), _) => KillSource::FallDamage,