Refactor floor items to use centralised items intmap
This commit is contained in:
@@ -24,18 +24,14 @@ copyItemToFloorID pos it w =
|
||||
w'
|
||||
& cWorld . lWorld . floorItems %~ IM.insert (_unNInt $ _itID it) theflit
|
||||
& cWorld . lWorld . itemLocations %~ IM.insert (_unNInt $ _itID it) OnFloor
|
||||
& cWorld . lWorld . items . ix (_unNInt $ _itID it) . itLocation .~ OnFloor
|
||||
& hud . closeItems %~ (_itID it:)
|
||||
-- & hud . hudElement . diSections . ix 3 . ssOffset .~ 0
|
||||
-- ensures dropped item is at the top of the close item selection list
|
||||
where
|
||||
(p', w') = findWallFreeDropPoint (_dimRad $ itDim it) pos w
|
||||
rot = fst . randomR (- pi, pi) $ _randGen w
|
||||
theflit =
|
||||
FlIt
|
||||
{ _flIt = it & itLocation .~ OnFloor
|
||||
, _flItPos = p'
|
||||
, _flItRot = rot
|
||||
}
|
||||
theflit = FlIt { _flItPos = p' , _flItRot = rot }
|
||||
|
||||
cardinalVectors :: [Point2]
|
||||
cardinalVectors =
|
||||
|
||||
Reference in New Issue
Block a user