Cleanup, hlints

This commit is contained in:
2025-07-12 21:35:35 +01:00
parent 5544e891c5
commit dc631263da
9 changed files with 58 additions and 74 deletions
+5 -6
View File
@@ -153,7 +153,7 @@ invRootItemEffs cr =
invItemLocUpdate :: Creature -> LocationDT OItem -> World -> World
invItemLocUpdate cr loc w = doAnyEquipmentEffect loc cr $ case itm ^. itType of
ATTACH BULLETSYNTH -> trySynthBullet loc w
EQUIP WRIST_ECG | haspulse -> tryUseParent (loc) w
EQUIP WRIST_ECG | haspulse -> tryUseParent loc w
COPIER _ -> copierItemUpdate itm cr w
HELD FLATSHIELD -> rootNotrootEff createShieldWall removeShieldWall itm cr w
HELD MINIGUNX{} -> coolMinigun itm w
@@ -293,8 +293,7 @@ drawARHUD (LocDT con _) w = fromMaybe w $ do
shineTargetLaser :: Creature -> LocationDT OItem -> World -> World
shineTargetLaser cr loc w = fromMaybe (w & pointittarg . itTgPos .~ Nothing) $ do
guard (crIsAiming cr)
-- (_, mag) <- find (isammolink . fst) (itmtree ^. ldtLeft)
( mag) <- find (isammolink . (^. dtValue . _2)) (itmtree ^. dtLeft)
mag <- find (isammolink . (^. dtValue . _2)) (itmtree ^. dtLeft)
i <- mag ^. dtValue . _1 . itConsumables
guard $ i >= x
maginvid <- mag ^? dtValue . _1 . itLocation . ilInvID
@@ -316,7 +315,7 @@ shineTargetLaser cr loc w = fromMaybe (w & pointittarg . itTgPos .~ Nothing) $ d
, _lpType = TargetingLaser (_itID itm)
}
where
o = locOrient (loc) cr
o = locOrient loc cr
itmtree = loc ^. locDT
(p, q) = o `Q.comp` (V3 5 0 0, Q.qID)
x = 1
@@ -332,7 +331,7 @@ shineTargetLaser cr loc w = fromMaybe (w & pointittarg . itTgPos .~ Nothing) $ d
shineTorch :: Creature -> LocationDT OItem -> World -> World
shineTorch cr loc = fromMaybe id $ do
( mag) <- find (isammolink . (^. dtValue . _2)) (itmtree ^. dtLeft)
mag <- find (isammolink . (^. dtValue . _2)) (itmtree ^. dtLeft)
i <- mag ^. dtValue . _1 . itConsumables
guard $ crIsAiming cr
guard $ i >= x
@@ -342,7 +341,7 @@ shineTorch cr loc = fromMaybe id $ do
. (cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix invid . itConsumables . _Just -~ x)
where
itmtree = loc ^. locDT
(p, q) = locOrient (loc) cr
(p, q) = locOrient loc cr
x = 10
isammolink AmmoMagSF{} = True
isammolink _ = False