Tweak item dropping
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
All good (594 modules, at 15:00:52)
|
All good (594 modules, at 15:18:36)
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ copyItemToFloorID pos it w =
|
|||||||
w'
|
w'
|
||||||
& cWorld . lWorld . floorItems . unNIntMap %~ IM.insert flid theflit
|
& cWorld . lWorld . floorItems . unNIntMap %~ IM.insert flid theflit
|
||||||
& cWorld . lWorld . itemLocations %~ IM.insert (_unNInt $ _itID it) (OnFloor $ NInt flid)
|
& cWorld . lWorld . itemLocations %~ IM.insert (_unNInt $ _itID it) (OnFloor $ NInt flid)
|
||||||
|
& hud . closeItems %~ (NInt flid:)
|
||||||
where
|
where
|
||||||
(p', w') = findWallFreeDropPoint (_dimRad $ _itDimension it) pos w
|
(p', w') = findWallFreeDropPoint (_dimRad $ _itDimension it) pos w
|
||||||
rot = fst . randomR (- pi, pi) $ _randGen w
|
rot = fst . randomR (- pi, pi) $ _randGen w
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ tryDropSelected mpos w = do
|
|||||||
cr <- w ^? cWorld . lWorld . creatures . ix 0
|
cr <- w ^? cWorld . lWorld . creatures . ix 0
|
||||||
(0, _) <- w ^? hud . hudElement . diSelection . _Just
|
(0, _) <- w ^? hud . hudElement . diSelection . _Just
|
||||||
xs <- w ^? hud . hudElement . diSelectionExtra
|
xs <- w ^? hud . hudElement . diSelectionExtra
|
||||||
return $ IS.foldr (dropItem cr) w xs
|
return . foldl' (flip $ dropItem cr) w . IS.toDescList $ xs
|
||||||
|
|
||||||
tryPickupSelected :: Int -> Maybe (Int,Int) -> World -> Maybe World
|
tryPickupSelected :: Int -> Maybe (Int,Int) -> World -> Maybe World
|
||||||
tryPickupSelected k mpos w = do
|
tryPickupSelected k mpos w = do
|
||||||
|
|||||||
Reference in New Issue
Block a user