From 4e47d7d97e7539e32767044200f6683d018a7e55 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Tue, 7 Jun 2022 19:30:57 +0200 Subject: [PATCH] Fix hack that breaks ammo drops from sold weapons. --- language.version | 4 ++-- zscript/weapons/swwm_baseweapon.zsc | 12 ++++-------- zscript/weapons/swwm_tastytreat.zsc | 6 ++---- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/language.version b/language.version index 987663978..328b249c0 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r101 \cu(Tue 7 Jun 18:27:52 CEST 2022)\c-"; -SWWM_SHORTVER="\cw1.3pre r101 \cu(2022-06-07 18:27:52)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r102 \cu(Tue 7 Jun 19:30:57 CEST 2022)\c-"; +SWWM_SHORTVER="\cw1.3pre r102 \cu(2022-06-07 19:30:57)\c-"; diff --git a/zscript/weapons/swwm_baseweapon.zsc b/zscript/weapons/swwm_baseweapon.zsc index 1e76ee9c9..e32b4d0f0 100644 --- a/zscript/weapons/swwm_baseweapon.zsc +++ b/zscript/weapons/swwm_baseweapon.zsc @@ -220,10 +220,8 @@ Class SWWMWeapon : Weapon abstract if ( dropme > 0 ) { // hacky, but it works - let a = Ammo(Spawn(AmmoType1,Owner.pos)); - a.Owner = Owner; - a.Amount = dropme; - a.CreateTossable(dropme); + ownedWeapon.Ammo1.CreateTossable(dropme); + ownedWeapon.Ammo1.Amount += dropme; } } } @@ -258,10 +256,8 @@ Class SWWMWeapon : Weapon abstract if ( dropme > 0 ) { // hacky, but it works - let a = Ammo(Spawn(AmmoType2,Owner.pos)); - a.Owner = Owner; - a.Amount = dropme; - a.CreateTossable(dropme); + ownedWeapon.Ammo2.CreateTossable(dropme); + ownedWeapon.Ammo2.Amount += dropme; } } } diff --git a/zscript/weapons/swwm_tastytreat.zsc b/zscript/weapons/swwm_tastytreat.zsc index f945222f6..a7d585e35 100644 --- a/zscript/weapons/swwm_tastytreat.zsc +++ b/zscript/weapons/swwm_tastytreat.zsc @@ -79,10 +79,8 @@ Class CandyGun : SWWMWeapon if ( dropme > 0 ) { // hacky, but it works - let a = Ammo(Spawn(AmmoType1,Owner.pos)); - a.Owner = Owner; - a.Amount = dropme; - a.CreateTossable(dropme); + ownedWeapon.Ammo1.CreateTossable(dropme); + ownedWeapon.Ammo1.Amount += dropme; } } }