Move hotkeys out of Creature into LWorld

This commit is contained in:
2024-12-19 15:29:20 +00:00
parent 4526119fcd
commit 910c683eac
11 changed files with 24 additions and 19 deletions
+3 -3
View File
@@ -52,10 +52,10 @@ chargeIfInInventory itm cr w =
maxcharge = itm ^?! itUse . leftConsumption . wpMaxCharge
chargeIfEquipped :: Item -> Creature -> World -> World
chargeIfEquipped itm cr
| invid `IM.member` (cr ^. crInvHotkeys) =
chargeIfEquipped itm cr w
| invid `IM.member` (w ^. cWorld . lWorld . imHotkeys) = w &
ptrWpCharge %~ (min maxcharge . (+ 1))
| otherwise = ptrWpCharge .~ 0
| otherwise = w & ptrWpCharge .~ 0
where
invid = _ilInvID $ _itLocation itm
ptrWpCharge = cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix invid . itUse . leftConsumption . wpCharge