Improvements to death and cheat handling

Extra safety to ensure dummy Actor deaths properly emulate a real death and aren't duplicate called. Fixed a crash when using the kill command while set to unmorph on death. Super morphing is now possible while using the morphme cheat if passing the morph class directly. Added a flag to ignore player invulnerability completely when morphing.
This commit is contained in:
Boondorl 2024-02-07 17:56:38 -05:00 committed by Rachael Alexanderson
commit 3033fafaa7
8 changed files with 44 additions and 23 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();
}