Work on inventory management
This commit is contained in:
@@ -36,8 +36,7 @@ crCurrentEquipment cr =
|
||||
|
||||
strFromHeldItem :: Creature -> Int
|
||||
strFromHeldItem cr
|
||||
| _posture (_crStance cr) == Aiming || crIsReloading cr =
|
||||
negate $ fromMaybe 0 $ cr ^? crInv . ix itRef . itUse . heldAim . aimWeight
|
||||
| _posture (_crStance cr) == Aiming || crIsReloading cr = negate $ fromMaybe 0 $ do
|
||||
i <- cr ^? crManipulation . isel . ispItem
|
||||
cr ^? crInv . ix i . itUse . heldAim . aimWeight
|
||||
| otherwise = 0
|
||||
where
|
||||
itRef = cr ^?! crInvSel . isel . ispItem -- unsafe!! TODO change
|
||||
|
||||
Reference in New Issue
Block a user