diff options
Diffstat (limited to 'users/grfn/xanthous/src/Xanthous')
-rw-r--r-- | users/grfn/xanthous/src/Xanthous/App.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/users/grfn/xanthous/src/Xanthous/App.hs b/users/grfn/xanthous/src/Xanthous/App.hs index 32f03e8392ef..4ae549d15983 100644 --- a/users/grfn/xanthous/src/Xanthous/App.hs +++ b/users/grfn/xanthous/src/Xanthous/App.hs @@ -297,8 +297,10 @@ handleCommand DescribeInventory = do handleCommand Wield = do hs <- use $ character . inventory . wielded - selectItem $ \(MenuResult (item :: WieldedItem)) -> do + selectItem $ \(MenuResult (invPos, (item :: WieldedItem))) -> do selectHand hs $ \(MenuResult hand) -> do + character . inventory + %= removeItemFromPosition invPos (asWieldedItem # item) prevItems <- character . inventory . wielded %%= wieldInHand hand item character . inventory . backpack <>= fromList (map (view wieldedItem) prevItems) @@ -308,7 +310,7 @@ handleCommand Wield = do continue where selectItem = - takeItemFromInventory_ ["wield", "menu"] Cancellable asWieldedItem + selectItemFromInventory_ ["wield", "menu"] Cancellable asWieldedItem (say_ ["wield", "nothing"]) selectHand hs = menu_ ["wield", "hand"] Cancellable $ handsMenu hs itemsInHand (Hands i _) LeftHand = toList i |