Commit before only putting item locations in single itemLocations intmap

This commit is contained in:
2024-09-24 09:31:20 +01:00
parent 77e5f684aa
commit a6eb5cf982
8 changed files with 242 additions and 216 deletions
+2 -2
View File
@@ -23,14 +23,14 @@ copyItemToFloorID pos it w =
(,) (NInt flid) $
w'
& cWorld . lWorld . floorItems . unNIntMap %~ IM.insert flid theflit
& cWorld . lWorld . itemLocations . ix (_itID it) .~ OnFloor (NInt flid)
& cWorld . lWorld . itemLocations %~ IM.insert (_itID it) (OnFloor $ NInt flid)
where
(p', w') = findWallFreeDropPoint (_dimRad $ _itDimension it) pos w
rot = fst . randomR (- pi, pi) $ _randGen w
flid = IM.newKey . _unNIntMap . _floorItems . _lWorld $ _cWorld w
theflit =
FlIt
{ _flIt = it
{ _flIt = it & itLocation .~ OnFloor (NInt flid)
, _flItPos = p'
, _flItRot = rot
, _flItID = NInt flid