diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-09-06 00:12:47 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-09-06 00:12:47 -0300 |
| commit | 4c4e5381367f4739b4aeac14d1061da242a1eac2 (patch) | |
| tree | 6b616f8be87b4dfa1315656857850b51319083e7 /src/crplayer.cc | |
| parent | 8d565e911691a3740c283bd33ebc11d6d0fac6b7 (diff) | |
| download | game-4c4e5381367f4739b4aeac14d1061da242a1eac2.tar.gz game-4c4e5381367f4739b4aeac14d1061da242a1eac2.zip | |
fix character death recording logic
Diffstat (limited to 'src/crplayer.cc')
| -rw-r--r-- | src/crplayer.cc | 14 |
1 files changed, 14 insertions, 0 deletions
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; |
