Fix switch detection, cleanup

This commit is contained in:
2025-06-25 21:49:11 +01:00
parent a9cae4d409
commit 2f130c5bed
8 changed files with 13 additions and 32 deletions
+4 -4
View File
@@ -129,10 +129,10 @@ updateCloseObjects w =
$ w ^. cWorld . lWorld . floorItems . unNIntMap
isclose pos = dist ypos pos < 40 && hasButtonLOS ypos pos w
ypos = _crPos $ you w
activeButtons =
filter ((/= Just True) . (^? btEvent . btOn))
. IM.elems
$ w ^. cWorld . lWorld . buttons
activeButtons = filter canpress . IM.elems $ w ^. cWorld . lWorld . buttons
canpress bt = case bt ^. btEvent of
ButtonPress {_btOn = t} -> not t
_ -> True
changeSwapSel :: Int -> World -> World
changeSwapSel yi w