Unimplemented weapons trigger special on touch, to avoid potential softlocks.

This commit is contained in:
Mari the Deer 2023-01-19 22:37:03 +01:00
commit 8a719cfce5
2 changed files with 21 additions and 2 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r734 \cu(Thu 19 Jan 10:25:09 CET 2023)\c-";
SWWM_SHORTVER="\cw1.3pre r734 \cu(2023-01-19 10:25:09)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r735 \cu(Thu 19 Jan 22:40:26 CET 2023)\c-";
SWWM_SHORTVER="\cw1.3pre r735 \cu(2023-01-19 22:40:26)\c-";

View file

@ -51,6 +51,24 @@ Class SWWMWeapon : Weapon abstract
return null;
}
// temporarily needed to ensure unimplemented weapons can still activate their pickup specials, to avoid softlocks
private void OnTouchSpecials( Actor toucher )
{
DoPickupSpecial(toucher);
if ( bCountItem )
{
if ( toucher.player ) toucher.player.itemcount++;
level.found_items++;
bCountItem = false;
}
if ( bCountSecret )
{
if ( toucher.player ) toucher.player.mo.GiveSecret(true,true);
else toucher.GiveSecret(true,true);
bCountSecret = false;
}
}
override void Touch( Actor toucher )
{
// show message about unimplemented weapons
@ -59,6 +77,7 @@ Class SWWMWeapon : Weapon abstract
{
if ( toucher.CheckLocalView() )
Console.MidPrint(SmallFont,String.Format(StringTable.Localize(SWWMUtility.SellFemaleItem(self,"SWWM_TODOWEAPON_FEM")?"$SWWM_TODOWEAPON_FEM":"$SWWM_TODOWEAPON"),GetTag()));
OnTouchSpecials(toucher);
return;
}
// show prompt to swap weapon, and prevent normal pickup