Workaround to preserve collectibles after death exits.
This commit is contained in:
parent
82053dfd15
commit
f163ed3bef
4 changed files with 19 additions and 1 deletions
|
|
@ -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 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue