Remove reduntant left click item use code

This commit is contained in:
2024-11-29 20:40:14 +00:00
parent 1b99b73f44
commit de4a955206
9 changed files with 256 additions and 285 deletions
+4
View File
@@ -1,5 +1,7 @@
module Dodge.SelectUse (selectUse) where
import Control.Monad
import qualified SDL
import Control.Lens
import Data.Maybe
import Dodge.Data.ComposedItem
@@ -9,6 +11,8 @@ import Dodge.Payload
selectUse :: LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
selectUse ittree _ w = fromMaybe w $ do
lbtime <- w ^? input . mouseButtons . ix SDL.ButtonLeft
guard $ lbtime == 0
itid <- ittree ^? ldtValue . itID
pjid <- ittree ^? ldtValue . itUse . uaParams . apLinkedProjectile . _Just
thepj <- w ^? cWorld . lWorld . projectiles . ix pjid