Reapply "Improvements to death and cheat handling"

This reverts commit c7bba2a126.
This commit is contained in:
Boondorl 2024-04-17 19:55:08 -04:00 committed by Rachael Alexanderson
commit bcd6c6170e
No known key found for this signature in database
GPG key ID: 26A8ACCE97115EE0
25 changed files with 873 additions and 744 deletions

View file

@ -626,10 +626,13 @@ public:
double plyrdmgfact = Pawn->DamageFactor;
Pawn->DamageFactor = 1.;
P_DamageMobj (Pawn, Pawn, Pawn, TELEFRAG_DAMAGE, NAME_Suicide);
Pawn->DamageFactor = plyrdmgfact;
if (Pawn->health <= 0)
if (Pawn != nullptr)
{
Pawn->flags &= ~MF_SHOOTABLE;
Pawn->DamageFactor = plyrdmgfact;
if (Pawn->health <= 0)
{
Pawn->flags &= ~MF_SHOOTABLE;
}
}
Destroy();
}