diff --git a/language.version b/language.version index c73b44d09..2f1563455 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.24 \cu(Sun 12 Jun 15:24:58 CEST 2022)\c-"; -SWWM_SHORTVER="\cw1.2.24 \cu(2022-06-12 15:24:58)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.25 \cu(Mon 13 Jun 09:40:34 CEST 2022)\c-"; +SWWM_SHORTVER="\cw1.2.25 \cu(2022-06-13 09:40:34)\c-"; diff --git a/tools/excl.lst b/tools/excl.lst index 34decccca..034e3a2b1 100644 --- a/tools/excl.lst +++ b/tools/excl.lst @@ -1,4 +1,3 @@ -pk7 .git *.md docimg diff --git a/zscript/swwm_player.zsc b/zscript/swwm_player.zsc index 120c4afa5..43ba4f521 100644 --- a/zscript/swwm_player.zsc +++ b/zscript/swwm_player.zsc @@ -3211,6 +3211,29 @@ Class Demolitionist : PlayerPawn grav *= .25; vel.z -= grav; } + // the default PickWeapon code breaks when dual weapons are involved + // so we gotta roll out our own here + // + // I could rewrite PickNextWeapon and PickPrevWeapon as well, but nah + // those always call CheckAmmo so it's fine + override Weapon PickWeapon( int slot, bool checkammo ) + { + int slotsize = player.weapons.SlotSize(slot); + let cur = player.ReadyWeapon; + for ( int i=slotsize-1; i>=0; i-- ) + { + let type = player.weapons.GetWeapon(slot,i); + let w = Weapon(player.mo.FindInventory(type)); + if ( !w || (w == cur) || (cur && cur.bPOWERED_UP && (w == cur.SisterWeapon)) ) + continue; + String sn = w.GetClassName(); + bool dual = ((type is 'SWWMWeapon') && (sn.Left(4) ~== "Dual")); + if ( (!checkammo && (!dual || (w.SisterWeapon && (w.SisterWeapon.Amount > 1)))) + || w.CheckAmmo(Weapon.EitherFire,false) ) + return w; + } + return cur; + } override void MarkPrecacheSounds() { Super.MarkPrecacheSounds();