Fix extra item swapping
This commit is contained in:
@@ -334,14 +334,14 @@ changeInvSel i w
|
||||
|
||||
changeSwapInvSel :: Int -> World -> World
|
||||
changeSwapInvSel k w
|
||||
| n == 0 = w
|
||||
| yourInvSel w < n =
|
||||
w
|
||||
& cWorld . lWorld . creatures . ix 0 %~ updatecreature
|
||||
| otherwise =
|
||||
| yourInvSel w > n =
|
||||
w
|
||||
& cWorld . lWorld . creatures . ix 0 . crInvSel . iselPos .~ ico'
|
||||
& cWorld . lWorld . closeObjects %~ swapIndices (i - n) (ico' - n)
|
||||
& cWorld . lWorld . closeObjects %~ swapIndices (i - (n+1)) (ico' - (n+1))
|
||||
| otherwise = w
|
||||
where
|
||||
updatecreature =
|
||||
(crInv %~ IM.safeSwapKeys (i `mod` n) swapi)
|
||||
@@ -360,7 +360,7 @@ changeSwapInvSel k w
|
||||
| swapi == li = i
|
||||
| otherwise = li
|
||||
i = crSel cr
|
||||
ico' = ((i - (k + n)) `mod` numCO) + n
|
||||
ico' = ((i - (k + n + 1)) `mod` numCO) + n + 1
|
||||
n = length $ _crInv cr
|
||||
numCO = length $ w ^. cWorld . lWorld . closeObjects
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ drawSubInventory subinv cfig w = case subinv of
|
||||
extrapics
|
||||
closeobjectcursor = case selectedCloseObject w of
|
||||
Nothing -> mempty
|
||||
Just (i,co) -> drawCursorAt (invDisplayParams w & ldpCursorType .~ BorderCursor (Set.fromList [North,South])) cfig (Just i) (inventorySelectionList w)
|
||||
Just (i,_) -> drawCursorAt (invDisplayParams w & ldpCursorType .~ BorderCursor (Set.fromList [North,South])) cfig (Just i) (inventorySelectionList w)
|
||||
-- Just (i, co) ->
|
||||
-- listCursorNS
|
||||
-- clObjFloatIn
|
||||
|
||||
Reference in New Issue
Block a user