Simplify buttons

This commit is contained in:
2025-06-25 21:37:32 +01:00
parent 6e9d4918a1
commit a9cae4d409
13 changed files with 130 additions and 140 deletions
+2 -4
View File
@@ -15,8 +15,6 @@ doWdBl wb w = case wb of
dr <- w ^? cWorld . lWorld . doors . ix i
return (DoorHalfway == _drStatus dr)
WdBlCrFilterNearPoint r p t -> any (crNearPoint r p) (IM.filter (doCrBl t) (w ^. cWorld . lWorld . creatures))
--WdBlBtOn btid -> _btState (_buttons (_cWorld w) IM.! btid) == BtOn -- unsafe
WdBlBtOn btid -> (w ^?! cWorld . lWorld . buttons . ix btid . btState) == BtOn -- unsafe
--WdBlBtNotOff btid -> _btState (_buttons (_cWorld w) IM.! btid) /= BtOff -- unsafe
WdBlBtNotOff btid -> (w ^?! cWorld . lWorld . buttons . ix btid . btState) /= BtOff -- unsafe
WdBlBtOn btid -> (w ^?! cWorld . lWorld . buttons . ix btid . btEvent . btOn) -- unsafe
-- WdBlBtNotOff btid -> (w ^?! cWorld . lWorld . buttons . ix btid . btState) /= BtOff -- unsafe
WdBlNegate x -> not $ doWdBl x w