From cb54def1fba3ca3fb00b63189d591d88908f79cf Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Wed, 8 Nov 2023 21:32:43 +0100 Subject: [PATCH] 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. --- language.version | 4 ++-- zscript/swwm_gesture.zsc | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/language.version b/language.version index a91979e30..90aba9ebc 100644 --- a/language.version +++ b/language.version @@ -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-"; diff --git a/zscript/swwm_gesture.zsc b/zscript/swwm_gesture.zsc index 25e5818a0..7a57526e6 100644 --- a/zscript/swwm_gesture.zsc +++ b/zscript/swwm_gesture.zsc @@ -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();