Commit before extending selection sections: overlapping elements
This commit is contained in:
@@ -139,9 +139,9 @@ ammoCheckI :: ChainEffect
|
||||
ammoCheckI eff itm cr w = case itm ^? itUse . heldConsumption . laSource of
|
||||
Just (InternalSource ia) | _iaLoaded ia <= 0 || not (_iaPrimed ia)
|
||||
-> w
|
||||
Just (ExternalSource ea) | fromMaybe True $ do
|
||||
invid <- ea ^? _Just
|
||||
x <- cr ^? crInv . ix invid . itUse . equipEffect . eeUse . euseAmmoAmount
|
||||
Just AboveSource | fromMaybe True $ do
|
||||
invid <- itm ^? itLocation . ipInvID
|
||||
x <- cr ^? crInv . ix (invid - 1) . itUse . equipEffect . eeUse . euseAmmoAmount
|
||||
return $ x <= 0
|
||||
-> w
|
||||
_ -> eff itm cr $ w & cWorld . lWorld . creatures . ix (_crID cr) %~ crCancelReloading
|
||||
@@ -370,8 +370,8 @@ useAmmoAmount' :: Int -> Int -> IM.IntMap Item -> IM.IntMap Item
|
||||
useAmmoAmount' itref x inv = case inv ^? ix itref . itUse . heldConsumption . laSource of
|
||||
Just InternalSource{}
|
||||
-> inv & ix itref . itUse . heldConsumption . laSource . _InternalSource . iaLoaded -~ x
|
||||
Just (ExternalSource (Just eqid))
|
||||
-> inv & ix eqid . itUse . equipEffect . eeUse . euseAmmoAmount -~ x
|
||||
Just AboveSource
|
||||
-> inv & ix (itref - 1) . itUse . equipEffect . eeUse . euseAmmoAmount -~ x
|
||||
_ -> inv
|
||||
-- . crInv . ix itRef . itUse . heldConsumption . laSource
|
||||
|
||||
|
||||
Reference in New Issue
Block a user