Fix inventory bug
This commit is contained in:
@@ -25,19 +25,19 @@ module Dodge.Inventory (
|
|||||||
invDimColor,
|
invDimColor,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Dodge.Reloading
|
|
||||||
import Color
|
import Color
|
||||||
import Dodge.Inventory.Color
|
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import Dodge.Base
|
import Dodge.Base
|
||||||
import Dodge.Data.World
|
|
||||||
import Dodge.Data.Config
|
import Dodge.Data.Config
|
||||||
|
import Dodge.Data.World
|
||||||
import Dodge.Euse
|
import Dodge.Euse
|
||||||
import Dodge.Inventory.CheckSlots
|
import Dodge.Inventory.CheckSlots
|
||||||
import Dodge.Inventory.CloseObject
|
import Dodge.Inventory.CloseObject
|
||||||
|
import Dodge.Inventory.Color
|
||||||
import Dodge.Inventory.ItemSpace
|
import Dodge.Inventory.ItemSpace
|
||||||
import Dodge.ItEffect
|
import Dodge.ItEffect
|
||||||
|
import Dodge.Reloading
|
||||||
import Geometry
|
import Geometry
|
||||||
import qualified IntMapHelp as IM
|
import qualified IntMapHelp as IM
|
||||||
import LensHelp
|
import LensHelp
|
||||||
@@ -166,8 +166,7 @@ updateCloseObjects w =
|
|||||||
& cWorld . lWorld . creatures . ix 0 . crInvSel . iselPos %~ updateinvsel
|
& cWorld . lWorld . creatures . ix 0 . crInvSel . iselPos %~ updateinvsel
|
||||||
where
|
where
|
||||||
updateinvsel curinvsel
|
updateinvsel curinvsel
|
||||||
-- | length (augmentedInvSizes w) <= curinvsel = max 0 $ length (augmentedInvSizes w) - 1
|
| length (augmentedInvSizes w) <= curinvsel = max 0 $ length (augmentedInvSizes w) - 1
|
||||||
| length (augmentedInvSizes w) <= curinvsel = max 0 $ length (augmentedInvSizes w)
|
|
||||||
| otherwise = curinvsel
|
| otherwise = curinvsel
|
||||||
filt = filter $ \obj -> dist ypos (closeObjPos obj) < 40 && hasButtonLOS ypos (closeObjPos obj) w
|
filt = filter $ \obj -> dist ypos (closeObjPos obj) < 40 && hasButtonLOS ypos (closeObjPos obj) w
|
||||||
ypos = _crPos $ you w
|
ypos = _crPos $ you w
|
||||||
@@ -357,9 +356,7 @@ changeSwapInvSel k w
|
|||||||
numCO = length $ w ^. hud . closeObjects
|
numCO = length $ w ^. hud . closeObjects
|
||||||
|
|
||||||
changeAugInvSel :: Int -> World -> World
|
changeAugInvSel :: Int -> World -> World
|
||||||
changeAugInvSel i w
|
changeAugInvSel i w =
|
||||||
| n == 0 = w
|
|
||||||
| otherwise =
|
|
||||||
w
|
w
|
||||||
& cWorld . lWorld . creatures . ix 0 . crInvSel . iselPos %~ (`mod` n) . subtract i
|
& cWorld . lWorld . creatures . ix 0 . crInvSel . iselPos %~ (`mod` n) . subtract i
|
||||||
& cWorld . lWorld . creatures . ix 0 . crInvSel . iselAction .~ NoInvSelAction
|
& cWorld . lWorld . creatures . ix 0 . crInvSel . iselAction .~ NoInvSelAction
|
||||||
|
|||||||
Reference in New Issue
Block a user