Refactor floor items to use centralised items intmap

This commit is contained in:
2025-08-24 13:14:49 +01:00
parent c38d03165f
commit 22b4be440a
14 changed files with 170 additions and 152 deletions
+2 -1
View File
@@ -125,7 +125,8 @@ updateCloseObjects w =
g oldbts = intersect oldbts cbts `union` cbts
f olditems = intersect olditems citems `union` citems
lw = w ^. cWorld . lWorld
citems = lw^..floorItems . each . filtered (isclose . _flItPos) . to (_itID . _flIt)
citems = let is = IM.filter (isclose . _flItPos) (lw^.floorItems)
in map NInt $ IM.keys $ IM.intersection (lw ^. items) is
isclose x = dist y x < 40 && hasButtonLOS y x w
y = _crPos $ you w
cbts = lw^..buttons . each . filtered canpress . filtered (isclose . _btPos) . to _btID