Remove yourID -- you are simply at 0

This commit is contained in:
2022-10-28 21:26:14 +01:00
parent 32744d7cb3
commit d496c4c523
8 changed files with 18 additions and 24 deletions
+3 -4
View File
@@ -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