Remove yourID -- you are simply at 0
This commit is contained in:
@@ -26,7 +26,7 @@ updateWheelEvent yi w = case w ^. cWorld . lWorld . hud . hudElement of
|
||||
DisplayInventory NoSubInventory
|
||||
-- functions that modify the inventory should be centralised so that
|
||||
-- this lock can be sensibly applied, perhaps
|
||||
| w ^?! cWorld . lWorld . creatures . ix (w ^. cWorld . lWorld . yourID) . crInvLock -> w
|
||||
| w ^?! cWorld . lWorld . creatures . ix 0 . crInvLock -> w
|
||||
| rbDown -> case (yourItem w ^? _Just . itUse . heldScroll, _rbOptions w) of
|
||||
(_, EquipOptions{}) -> scrollRBOption y w
|
||||
(Nothing, _) -> closeObjScrollDir y w
|
||||
@@ -93,7 +93,7 @@ changeTweakParam mi i w = fromMaybe w $ do
|
||||
params <- yourItem w ^? _Just . itTweaks . tweakParams . ix paramid
|
||||
let x = (_tweakVal params + i) `mod` _tweakMax params
|
||||
return $
|
||||
w & cWorld . lWorld . creatures . ix (w ^. cWorld . lWorld . yourID) . crInv . ix (crSel (you w))
|
||||
w & cWorld . lWorld . creatures . ix 0 . crInv . ix (crSel (you w))
|
||||
%~ ( (itTweaks . tweakParams . ix paramid . tweakVal .~ x)
|
||||
. doTweak (_tweakType params) x
|
||||
)
|
||||
|
||||
@@ -55,7 +55,7 @@ pressedMBEffectsNoInventory pkeys w
|
||||
useItem (you w) w & hammers . ix DoubleMouseHam .~ HammerDown
|
||||
| justPressedDown ButtonLeft && inTopInv
|
||||
&& w ^?! hammers . ix DoubleMouseHam == HammerUp =
|
||||
useLeftItem (w ^. cWorld . lWorld . yourID) w
|
||||
useLeftItem 0 w
|
||||
| isDown ButtonLeft && inTopInv =
|
||||
w & hammers . ix DoubleMouseHam .~ HammerDown
|
||||
| isDown ButtonRight && inTopInv = w
|
||||
@@ -81,10 +81,9 @@ doCombine i w = case combineItemListYou w ^? ix i of
|
||||
-- set (hud . hudElement) (DisplayInventory NoSubInventory)
|
||||
selectinv --enterCombineInv
|
||||
. createPutItem it
|
||||
$ foldr (rmInvItem yid) w (sort is)
|
||||
$ foldr (rmInvItem 0) w (sort is)
|
||||
where
|
||||
yid = w ^. cWorld . lWorld . yourID
|
||||
selectinv (Just i', w') = w' & cWorld . lWorld . creatures . ix yid . crInvSel .~ InvSel i' NoInvSelAction
|
||||
selectinv (Just i', w') = w' & cWorld . lWorld . creatures . ix 0 . crInvSel .~ InvSel i' NoInvSelAction
|
||||
selectinv (Nothing, w') = w'
|
||||
|
||||
updatePressedButtonsCarte :: M.Map MouseButton Bool -> World -> World
|
||||
|
||||
Reference in New Issue
Block a user