Workaround to preserve collectibles after death exits.

This commit is contained in:
Mari the Deer 2020-12-16 03:01:28 +01:00
commit f163ed3bef
4 changed files with 19 additions and 1 deletions

View file

@ -993,6 +993,15 @@ Class SWWMHandler : EventHandler
// reset score (optional) if inventory should be cleared
if ( swwm_resetscore && level.removeitems && !e.IsReturn )
c.credits = c.hcredits = 0;
// re-add any missing collectibles after a death exit (yes, this happens)
for ( int i=0; i<s.ownedcollectibles.Size(); i++ )
{
if ( p.mo.FindInventory(s.ownedcollectibles[i]) ) continue;
let c = SWWMCollectible(Actor.Spawn(s.ownedcollectibles[i],p.mo.pos));
c.propagated = true;
if ( !c.CallTryPickup(p.mo) )
c.Destroy();
}
}
override void PlayerRespawned( PlayerEvent e )