Refactor crPos to be a V3

This commit is contained in:
2025-10-10 13:47:31 +01:00
parent 98ece551c7
commit 49fb982877
58 changed files with 375 additions and 307 deletions
+2 -2
View File
@@ -383,7 +383,7 @@ updateKeysInTerminal :: Int -> Universe -> Universe
updateKeysInTerminal tmid u = fromMaybe deactivate $ do
tm <- u ^? uvWorld . cWorld . lWorld . terminals . ix tmid
x <- u ^? uvWorld . cWorld . lWorld . buttons . ix (tm ^. tmButtonID) . btPos
y <- u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crPos
y <- u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crPos . _xy
case tm ^. tmStatus of
_ | dist x y > 40 || not (hasButtonLOS x y (u ^. uvWorld)) -> Nothing
TerminalDeactivated -> Nothing
@@ -553,7 +553,7 @@ tryCombine (i, j) w = fromMaybe w $ do
. ix j
. siPayload
. _Just
p <- w ^? cWorld . lWorld . creatures . ix 0 . crPos
p <- w ^? cWorld . lWorld . creatures . ix 0 . crPos . _xy
return $
createItemYou it (foldr (destroyInvItem 0 . NInt) w (sort is))
& soundStart InventorySound p wrench1S Nothing