Fix usage of AddInventory instead of AttachToOwner in gestures.

- While this didn't really cause any major issues, it did have the problem of
   leaving lingering instances of the gesture actors as invisible, untouchable
   weapon pickups at 0,0 coordinates (which could block use to pickup of any
   other pickups located in the same position).
 - For existing savegames, the Used and Touch functions have been overriden
   so these actions just "pass through", fixing the blockage. Still, it's
   recommended to either start a fresh game, or, as a sort of hotfix, use the
   `take` console command to remove the gesture weapons from your inventory,
   as they will be automatically re-added next time a gesture is to be played.
This commit is contained in:
Mari the Deer 2023-11-08 21:32:43 +01:00
commit cb54def1fb
2 changed files with 19 additions and 5 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1002 \cu(Tue 7 Nov 14:48:33 CET 2023)\c-";
SWWM_SHORTVER="\cw1.3pre r1002 \cu(2023-11-07 14:48:33)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1004 \cu(Wed 8 Nov 21:34:44 CET 2023)\c-";
SWWM_SHORTVER="\cw1.3pre r1004 \cu(2023-11-08 21:34:44)\c-";

View file

@ -45,6 +45,13 @@ Class SWWMGesture : SWWMWeapon
{
return false;
}
override bool Used( Actor user )
{
return false;
}
override void Touch( Actor toucher )
{
}
override void DoEffect()
{
Super.DoEffect();
@ -108,7 +115,7 @@ Class SWWMGesture : SWWMWeapon
if ( !w )
{
w = SWWMGesture(Spawn("SWWMGesture"));
mo.AddInventory(w);
w.AttachToOwner(mo);
}
if ( mo.player.PendingWeapon != WP_NOCHANGE ) w.formerweapon = mo.player.PendingWeapon;
else w.formerweapon = mo.player.ReadyWeapon;
@ -143,7 +150,7 @@ Class SWWMGesture : SWWMWeapon
if ( !w )
{
w = SWWMGesture(Spawn("SWWMGesture"));
mo.AddInventory(w);
w.AttachToOwner(mo);
}
if ( mo.player.PendingWeapon != WP_NOCHANGE ) w.formerweapon = mo.player.PendingWeapon;
else w.formerweapon = mo.player.ReadyWeapon;
@ -423,7 +430,7 @@ Class SWWMGesture : SWWMWeapon
if ( !g )
{
g = SWWMItemGesture(Spawn(invoker.whichweapon));
AddInventory(g);
g.AttachToOwner(self);
}
g.gest = invoker;
player.ReadyWeapon = g;
@ -668,6 +675,13 @@ Class SWWMItemGesture : SWWMWeapon abstract
{
return false;
}
override bool Used( Actor user )
{
return false;
}
override void Touch( Actor toucher )
{
}
override void DoEffect()
{
Super.DoEffect();