Cleanup targeting

This commit is contained in:
2023-01-05 11:01:12 +00:00
parent c48a553967
commit 0302685053
24 changed files with 66 additions and 95 deletions
+3 -3
View File
@@ -270,12 +270,12 @@ updateAutoRecharge it = case it ^? itUse . leftConsumption of
_ -> it
doItemTargeting :: Int -> Creature -> World -> World
doItemTargeting invid cr w = case cr ^? crInv . ix invid . itTargeting of
doItemTargeting invid cr w = case cr ^? crInv . ix invid . itUse . heldTargeting of
Nothing -> w
Just NoTargeting -> w
Just t ->
let (w', t') = updateTargeting (_tgUpdate t) (_crInv cr IM.! invid) cr w t
in w' & cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix invid . itTargeting .~ t'
let (w', t') = updateTargeting (_tgType t) (_crInv cr IM.! invid) cr w t
in w' & cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix invid . itUse . heldTargeting .~ t'
weaponReloadSounds :: Creature -> World -> World
weaponReloadSounds cr w = case cr ^? crInvSel . iselAction of