Fix multiple left click explosions of remote rockets
This commit is contained in:
@@ -14,6 +14,8 @@ selectUse itm _ w = fromMaybe w $ do
|
|||||||
itid <- itm ^? itID
|
itid <- itm ^? itID
|
||||||
pjid <- itm ^? itUse . uaParams . apLinkedProjectile . _Just
|
pjid <- itm ^? itUse . uaParams . apLinkedProjectile . _Just
|
||||||
thepj <- w ^? cWorld . lWorld . projectiles . ix pjid
|
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 $
|
return $
|
||||||
w
|
w
|
||||||
& cWorld . lWorld . projectiles . ix pjid . prjUpdates .~ [DestroyPU (Just itid) 30] -- 69 is placeholder, should be removed
|
& 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 . heldUse .~ HeldDoNothing
|
||||||
-- & itPoint . itUse . heldMods .~ DoNothingMod
|
-- & itPoint . itUse . heldMods .~ DoNothingMod
|
||||||
& usePayload (_prjPayload thepj) (_prjPos thepj)
|
& usePayload (_prjPayload thepj) (_prjPos thepj)
|
||||||
|
where
|
||||||
|
notdestroyed DestroyPU{} = False
|
||||||
|
notdestroyed _ = True
|
||||||
|
|
||||||
|
|
||||||
-- where
|
-- where
|
||||||
-- itPoint = pointerToItemLocation $ w ^?! cWorld . lWorld . itemLocations . ix itid-- _itemLocations (_cWorld w) IM.! itid
|
-- itPoint = pointerToItemLocation $ w ^?! cWorld . lWorld . itemLocations . ix itid-- _itemLocations (_cWorld w) IM.! itid
|
||||||
|
|||||||
Reference in New Issue
Block a user