Remove Machine Pistol update when fail firing

This commit is contained in:
2025-08-10 19:17:38 +01:00
parent 71c269667d
commit 38e8f91346
+3 -13
View File
@@ -373,16 +373,9 @@ applyCME loc cr cme
. applySidePush spush cr
. applyTorqueCME itm cr
. applyRecoil loc cr
| otherwise = case itm ^. itType of
HELD MACHINEPISTOL ->
cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix itid . itParams
.~ WarmTime (coolstart - 1) True Nothing
-- the above is quite hacky for now
_ -> failsound
| otherwise = failsound
where
itm = loc ^. locDT . dtValue . _1
coolstart = fromMaybe 0 $ baseItemTriggerType itm ^? coolStart
itid = itm ^?! itLocation . ilInvID -- unsafe
spush = maybe 0 itemSidePush $ itm ^? itType . ibtHeld
failsound w = case w ^? input . mouseButtons . ix SDL.ButtonLeft of
Just 0 -> soundStart (CrWeaponFailSound (_crID cr)) (_crPos cr) click1S Nothing w
@@ -632,10 +625,11 @@ heldTorqueAmount = \case
BLINKER -> 0
BLINKERUNSAFE -> 0
-- fugly
loadMuzzle :: LocationDT OItem -> Creature -> (Bool, World) -> Muzzle -> (Bool, World)
loadMuzzle loc cr (b, w) mz = maybe (b, w) (True,) $ do
case mz ^. mzAmmoSlot of
NoAmmoRequired -> return (doMuzzleEffect loc cr mz Nothing w)
NoAmmoRequired -> return (useLoadedAmmo loc cr mz Nothing w)
as -> do
mag <- case as of
MagBelow mi _ -> find (isAmmoIntLink mi . (^. dtValue . _2)) (loc ^. locDT . dtLeft)
@@ -723,10 +717,6 @@ basicMuzFlare pos dir =
isAmmoIntLink :: Int -> ItemSF -> Bool
isAmmoIntLink i sf = Just i == sf ^? amsfLink
doMuzzleEffect :: LocationDT OItem -> Creature -> Muzzle
-> Maybe (Int, DTree OItem) -> World -> World
doMuzzleEffect _ _ _ _ = id
useLoadedAmmo ::
LocationDT OItem ->
Creature ->