Fix more item bugs

This commit is contained in:
2025-08-24 23:50:16 +01:00
parent c2daa86463
commit d776c91cfd
9 changed files with 113 additions and 99 deletions
+4 -12
View File
@@ -1,15 +1,12 @@
module Dodge.FloorItem (
copyItemToFloor,
-- copyItemToFloorID,
) where
module Dodge.FloorItem (copyItemToFloor) where
import Control.Lens
import Data.Maybe
import Data.Monoid
import Dodge.Base
import Dodge.Data.World
import Dodge.Item.InvSize
import Geometry
import LensHelp
--import qualified IntMapHelp as IM
import NewInt
import System.Random
@@ -20,7 +17,7 @@ copyItemToFloor pos it w =
w'
& cWorld . lWorld . floorItems . at (_unNInt $ _itID it) ?~ theflit
& cWorld . lWorld . items . at (_unNInt $ _itID it) ?~ (it & itLocation .~ OnFloor)
& hud . closeItems %~ (_itID it :)
& hud . closeItems .:~ _itID it
where
-- & hud . hudElement . diSections . ix 3 . ssOffset .~ 0
-- ensures dropped item is at the top of the close item selection list
@@ -29,12 +26,7 @@ copyItemToFloor pos it w =
theflit = FlIt{_flItPos = p', _flItRot = rot}
cardinalVectors :: [Point2]
cardinalVectors =
[ V2 1 0
, V2 0 1
, V2 (-1) 0
, V2 0 (-1)
]
cardinalVectors = [ V2 1 0 , V2 0 1 , V2 (-1) 0 , V2 0 (-1) ]
findWallFreeDropPoint :: Float -> Point2 -> World -> (Point2, World)
findWallFreeDropPoint r p w =