Cleanup targeting

This commit is contained in:
2023-01-05 11:01:12 +00:00
parent c48a553967
commit 0302685053
24 changed files with 66 additions and 95 deletions
+3 -3
View File
@@ -71,13 +71,13 @@ useAmmoParams it cr w =
settrajectory traj = case traj of
BasicBulletTrajectory -> BasicBulletTrajectory
MagnetTrajectory{} -> fromMaybe BasicBulletTrajectory $ do
tpos <- it ^? itTargeting . tgPos . _Just
tpos <- it ^? itUse . heldTargeting . tgPos . _Just
return $ MagnetTrajectory tpos
FlechetteTrajectory{} -> fromMaybe BasicBulletTrajectory $ do
tpos <- it ^? itTargeting . tgPos . _Just
tpos <- it ^? itUse . heldTargeting . tgPos . _Just
return $ FlechetteTrajectory tpos
BezierTrajectory{} -> fromMaybe BasicBulletTrajectory $ do
tpos <- it ^? itTargeting . tgPos . _Just
tpos <- it ^? itUse . heldTargeting . tgPos . _Just
return $ BezierTrajectory sp tpos (mouseWorldPos (w ^. input) (w ^. cWorld . camPos))
bounceDir :: (Point2, Either Creature Wall) -> Maybe Point2