Make all items have an id an associated location

This commit is contained in:
2022-08-01 23:50:26 +01:00
parent 237cd3e020
commit 82aedc3830
11 changed files with 123 additions and 84 deletions
+1 -3
View File
@@ -25,9 +25,7 @@ copyItemToFloorID pos it w =
where
(p', w') = findWallFreeDropPoint (_dimRad $ _itDimension it) pos w
rot = fst . randomR (- pi, pi) $ _randGen w
updateLocation = case it ^? itID of
Just (Just i') -> cWorld . itemLocations . ix i' .~ OnFloor flid
_ -> id
updateLocation = cWorld . itemLocations . ix (_itID it) .~ OnFloor flid
flid = IM.newKey $ _floorItems (_cWorld w)
theflit =
FlIt