Cleanup launcher code

This commit is contained in:
2024-10-01 01:43:51 +01:00
parent 5a4f2711c8
commit 5091709f70
5 changed files with 11 additions and 27 deletions
+2 -7
View File
@@ -457,15 +457,10 @@ createProjectile magtree muz itmtree cr = fromMaybe failsound $ do
magid <- magtree ^? ldtValue . itLocation . ilInvID
ammoitem <- cr ^? crInv . ix magid
let homing = determineProjectileTracking magtree itmtree
j <- ammoitem ^? itLocation . ilInvID
aparams <- ammoitem ^? itUse . amagParams
return $ createShell homing aparams muz itm cr
aparams <- ammoitem ^? itUse . amagParams . ampPayload
return $ createShell homing aparams muz cr
. startthesound
. useammo j
where
itm = itmtree ^. ldtValue
useammo j = cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix j . itUse . amagLoadStatus . iaLoaded -~ 1
-- the sound should be moved to the projectile firing
startthesound = soundMultiFrom [CrWeaponSound (_crID cr) j | j <- [0..3]] (_crPos cr) tap4S Nothing
-- failsound = soundContinue (CrWeaponSound (_crID cr) 0) (_crPos cr) click1S Nothing