Fix broken death exit in Doom E1M8.

This commit is contained in:
Mari the Deer 2021-10-23 11:50:43 +02:00
commit 142802798b
3 changed files with 5 additions and 5 deletions

View file

@ -100,7 +100,7 @@ extend Class SWWMHandler
// reset score on dead players (death exit™)
for ( int i=0; i<MAXPLAYERS; i++ )
{
if ( !playeringame[i] || (players[i].Health > 0) ) continue;
if ( !playeringame[i] || (players[i].playerstate != PST_DEAD) ) continue;
let c = SWWMCredits.Find(players[i]);
if ( c ) c.credits = c.hcredits = 0;
}
@ -112,7 +112,7 @@ extend Class SWWMHandler
{
for ( int i=0; i<MAXPLAYERS; i++ )
{
if ( !playeringame[i] || !players[i].mo ) continue;
if ( !playeringame[i] || !players[i].mo || (players[i].playerstate == PST_DEAD) ) continue;
players[i].mo.GiveInventory("InventoryWipeToken",1);
// the playerpawn will know what to do with this in its PreTravelled()
}

View file

@ -2935,7 +2935,7 @@ Class Demolitionist : PlayerPawn
// clean up attached actors
if ( selflight ) selflight.Destroy();
// inventory wipes
if ( FindInventory("InventoryWipeToken") )
if ( FindInventory("InventoryWipeToken") && (player.playerstate != PST_DEAD) )
SWWMUtility.WipeInventory(self,swwm_resetscore);
}
override void Travelled()