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