Fix handling of inventory resets.
This commit is contained in:
parent
ade23e99fc
commit
61824088ff
2 changed files with 12 additions and 6 deletions
|
|
@ -1,3 +1,3 @@
|
|||
[default]
|
||||
SWWM_MODVER="\chSWWM \czGZ\c- \cw1.1.39 \cu(Fri 5 Nov 20:53:58 CET 2021)\c-";
|
||||
SWWM_SHORTVER="\cw1.1.39 \cu(2021-11-05 20:53:58)\c-";
|
||||
SWWM_MODVER="\chSWWM \czGZ\c- \cw1.1.40 \cu(Fri 5 Nov 23:29:26 CET 2021)\c-";
|
||||
SWWM_SHORTVER="\cw1.1.40 \cu(2021-11-05 23:29:26)\c-";
|
||||
|
|
|
|||
|
|
@ -1877,18 +1877,24 @@ Class SWWMUtility
|
|||
}
|
||||
|
||||
// sets all carried ammo back to zero
|
||||
// resets hammerspace capacity
|
||||
static play void ResetAmmo( Actor mo )
|
||||
{
|
||||
PlayerInfo p = mo.player;
|
||||
if ( !p || !p.mo ) return;
|
||||
for ( Inventory i=p.mo.inv; i; i=i.inv )
|
||||
{
|
||||
if ( !(i is 'Ammo') ) continue;
|
||||
i.Amount = 0;
|
||||
if ( i is 'Ammo' )
|
||||
{
|
||||
i.Amount = 0;
|
||||
i.MaxAmount = i.default.MaxAmount;
|
||||
}
|
||||
if ( i is 'HammerspaceEmbiggener' )
|
||||
i.Amount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// removes all carried items that aren't weapons or ammo
|
||||
// removes all usable items
|
||||
static play void ResetItems( Actor mo )
|
||||
{
|
||||
PlayerInfo p = mo.player;
|
||||
|
|
@ -1897,7 +1903,7 @@ Class SWWMUtility
|
|||
while ( last.inv )
|
||||
{
|
||||
let inv = last.inv;
|
||||
if ( (inv is 'SWWMCollectible') || (inv is 'Weapon') || (inv is 'Ammo') || (inv is 'SWWMArmor') )
|
||||
if ( !inv.bINVBAR )
|
||||
{
|
||||
last = inv;
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue