Refactor floor items to use centralised items intmap
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user