summaryrefslogtreecommitdiffstats
path: root/src/HWiidPlayer.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/HWiidPlayer.hs')
-rw-r--r--src/HWiidPlayer.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/HWiidPlayer.hs b/src/HWiidPlayer.hs
index 9517394..18fafba 100644
--- a/src/HWiidPlayer.hs
+++ b/src/HWiidPlayer.hs
@@ -55,7 +55,7 @@ instance Player HWiidPlayer where
(aimx, aimy) = if null aims then (0, 0) else mulV (1/(fromIntegral $ length aims)) (foldr addV (0, 0) aims)
ax = realToFrac $ aimx - (fromRational . toRational . tankX $ tank)
ay = realToFrac $ aimy - (fromRational . toRational . tankY $ tank)
- aim = if (ax /= 0 || ay /= 0) then Just . V.fromVector $ V.Vector ax ay else Nothing
+ aim = if (ax /= 0 || ay /= 0) then Just . fst . V.fromVector $ V.Vector ax ay else Nothing
move = (mx /= 0 || my /= 0)
angle = atan2 my mx