diff --git a/src/Dodge/SelectUse.hs b/src/Dodge/SelectUse.hs index e52ecc10d..5bd221091 100644 --- a/src/Dodge/SelectUse.hs +++ b/src/Dodge/SelectUse.hs @@ -14,6 +14,8 @@ selectUse itm _ w = fromMaybe w $ do itid <- itm ^? itID pjid <- itm ^? itUse . uaParams . apLinkedProjectile . _Just thepj <- w ^? cWorld . lWorld . projectiles . ix pjid + topupdate <- thepj ^? prjUpdates . ix 0 + guard $ notdestroyed topupdate -- this assumes that "destroyed" projectiles always have the same type of update at the top return $ w & cWorld . lWorld . projectiles . ix pjid . prjUpdates .~ [DestroyPU (Just itid) 30] -- 69 is placeholder, should be removed @@ -21,6 +23,10 @@ selectUse itm _ w = fromMaybe w $ do -- & itPoint . itUse . heldUse .~ HeldDoNothing -- & itPoint . itUse . heldMods .~ DoNothingMod & usePayload (_prjPayload thepj) (_prjPos thepj) + where + notdestroyed DestroyPU{} = False + notdestroyed _ = True + -- where -- itPoint = pointerToItemLocation $ w ^?! cWorld . lWorld . itemLocations . ix itid-- _itemLocations (_cWorld w) IM.! itid