Add attached/aiming checks on item usage

This commit is contained in:
2025-01-01 11:36:33 +00:00
parent 99114c7351
commit 91111fc89c
10 changed files with 393 additions and 423 deletions
+1 -4
View File
@@ -3,7 +3,6 @@ module Dodge.Projectile.Update (
updateProjectile,
) where
import Control.Monad
import Data.Foldable
import Data.List (delete)
import Data.Maybe
@@ -118,9 +117,7 @@ destroyProjectile mitid pjid w =
removelink = fromMaybe id $ do
itid <- fmap _unNInt mitid
loc <- w ^? cWorld . lWorld . itemLocations . ix itid
itm <- w ^? pointerToItemLocation loc . itUse . uaParams . apLinkedProjectile . _Just
guard $ itm == pjid
return $ pointerToItemLocation loc . itUse . uaParams . apLinkedProjectile .~ Nothing
return $ pointerToItemLocation loc . itUse . uaParams . apProjectiles %~ delete pjid
doThrust :: Projectile -> Maybe RocketSmoke -> World -> World
doThrust pj smoke w =