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/crmain.cc | |
| parent | 8d565e911691a3740c283bd33ebc11d6d0fac6b7 (diff) | |
| download | game-4c4e5381367f4739b4aeac14d1061da242a1eac2.tar.gz game-4c4e5381367f4739b4aeac14d1061da242a1eac2.zip | |
fix character death recording logic
Diffstat (limited to 'src/crmain.cc')
| -rw-r--r-- | src/crmain.cc | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/crmain.cc b/src/crmain.cc index 586f78e..f2f13ac 100644 --- a/src/crmain.cc +++ b/src/crmain.cc @@ -817,34 +817,16 @@ int TCreature::Damage(TCreature *Attacker, int Damage, int DamageType){ } if(this->Type == PLAYER){ - if(MurdererID != 0 && MurdererID != this->ID){ - bool Justified = true; - if(IsCreaturePlayer(MurdererID)){ - TPlayer *Murderer = GetPlayer(MurdererID); - if(Murderer != NULL){ - Justified = Murderer->IsAttackJustified(this->ID); - Murderer->RecordMurder(this->ID); - } - } - CharacterDeathOrder(this, OldLevel, MurdererID, Remark, !Justified); - } + ((TPlayer*)this)->RecordDeath(MurdererID, OldLevel, Remark); uint32 MostDangerousID = this->Combat.GetMostDangerousAttacker(); if(MostDangerousID != 0 && MostDangerousID != MurdererID - && MostDangerousID != this->ID && IsCreaturePlayer(MostDangerousID)){ - bool Justified = true; - TPlayer *MostDangerous = GetPlayer(MostDangerousID); - if(MostDangerous != NULL){ - Justified = MostDangerous->IsAttackJustified(this->ID); - MostDangerous->RecordMurder(this->ID); - } - // TODO(fusion): The original function is confusing at this point // but it seems correct that the remark is included only with the // murderer. - CharacterDeathOrder(this, OldLevel, MostDangerousID, "", !Justified); + ((TPlayer*)this)->RecordDeath(MostDangerousID, OldLevel, ""); } } } |
