diff --git a/language.version b/language.version index fa276ffec..b1ec32dc8 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r934 \cu(Mon 21 Aug 11:17:43 CEST 2023)\c-"; -SWWM_SHORTVER="\cw1.3pre r934 \cu(2023-08-21 11:17:43)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r935 \cu(Mon 21 Aug 11:23:32 CEST 2023)\c-"; +SWWM_SHORTVER="\cw1.3pre r935 \cu(2023-08-21 11:23:32)\c-"; diff --git a/zscript/hud/swwm_hud_inventory.zsc b/zscript/hud/swwm_hud_inventory.zsc index d4623ca84..97bd254a3 100644 --- a/zscript/hud/swwm_hud_inventory.zsc +++ b/zscript/hud/swwm_hud_inventory.zsc @@ -66,7 +66,7 @@ extend Class SWWMStatusBar } for ( Inventory i=CPlayer.mo.Inv; i; i=i.Inv ) { - if ( (i is 'SWWMLamp') && SWWMLamp(i).bActivated ) + if ( (i is 'SWWMLamp') && (SWWMLamp(i).bActivated || (SWWMLamp(i).Charge < SWWMLamp(i).default.Charge)) ) { DrawInvIcon(i,xx,yy,selected:true,aspowerup:true); yy -= 34; diff --git a/zscript/items/swwm_lamp.zsc b/zscript/items/swwm_lamp.zsc index 16e2c66b3..1c0275ee4 100644 --- a/zscript/items/swwm_lamp.zsc +++ b/zscript/items/swwm_lamp.zsc @@ -498,6 +498,8 @@ Class SWWMLamp : Inventory Actor thelamp; int charge; + int inactivetime; + Property Charge : charge; override Inventory CreateCopy( Actor other ) @@ -580,6 +582,18 @@ Class SWWMLamp : Inventory f.A_StartSound("lamp/appear",CHAN_VOICE); } if ( bActive && !(level.maptime%35) && !isFrozen() ) Charge--; + if ( bActive || !thelamp ) inactivetime = 0; + else if ( thelamp ) + { + inactivetime++; + if ( inactivetime > 350 ) // hide the lamp after 10 seconds of inactivity, so it doesn't get in your way + { + let f = Spawn("SWWMItemFog",thelamp.pos); + f.A_StartSound("lamp/disappear",CHAN_VOICE); + thelamp.Destroy(); + bActivated = false; + } + } if ( Charge <= 0 ) { Amount--;