From 4c4e5381367f4739b4aeac14d1061da242a1eac2 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Sat, 6 Sep 2025 00:12:47 -0300 Subject: fix character death recording logic --- src/crplayer.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/crplayer.cc') diff --git a/src/crplayer.cc b/src/crplayer.cc index c4dbd80..86c2aba 100644 --- a/src/crplayer.cc +++ b/src/crplayer.cc @@ -1534,6 +1534,20 @@ void TPlayer::RecordMurder(uint32 VictimID){ } } +void TPlayer::RecordDeath(uint32 AttackerID, int OldLevel, const char *Remark){ + bool Justified = true; + if(AttackerID != 0 && AttackerID != this->ID && IsCreaturePlayer(AttackerID)){ + TPlayer *Attacker = GetPlayer(AttackerID); + if(Attacker == NULL){ + return; + } + + Justified = Attacker->IsAttackJustified(this->ID); + Attacker->RecordMurder(this->ID); + } + CharacterDeathOrder(this, OldLevel, AttackerID, Remark, !Justified); +} + int TPlayer::CheckPlayerkilling(int Now){ int LastDay = 0; int LastWeek = 0; -- cgit v1.2.3