Fix terminal distance bug

This commit is contained in:
2022-06-11 13:07:56 +01:00
parent 7b00867f6d
commit f41fbbbb8d
2 changed files with 7 additions and 7 deletions
+3 -2
View File
@@ -150,8 +150,9 @@ updateTerminal = checkTermDist
checkTermDist :: World -> World
checkTermDist w = case w ^? hud . hudElement . subInventory . termID of
Just btid -> fromMaybe (w & hud . hudElement .~ DisplayInventory NoSubInventory) $ do
btpos <- w ^? buttons . ix btid . btPos
Just tmid -> fromMaybe (w & hud . hudElement .~ DisplayInventory NoSubInventory) $ do
btid <- w ^? terminals . ix tmid . tmButtonID
btpos <- w ^? buttons . ix btid . btPos
if dist btpos (_crPos $ you w) < 40 then Just w else Nothing
Nothing -> w