Add attached/aiming checks on item usage
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user