Add tank furniture, stop autorotate when aiming

This commit is contained in:
2021-10-05 22:57:54 +01:00
parent cab8c25610
commit d46de1ca80
17 changed files with 186 additions and 48 deletions
+4 -2
View File
@@ -25,6 +25,7 @@ import Dodge.Floor
import Geometry
import Geometry.Vector3D
import SDL (MouseButton (..))
import Data.List
import Data.Maybe
import Data.Function
@@ -251,7 +252,8 @@ crCrSpring c1 c2 w
ifConfigWallRotate :: World -> World
ifConfigWallRotate w
| _rotate_to_wall $ _config w = rotateToOverlappingWall w
| (_rotate_to_wall $ _config w ) && not (ButtonRight `S.member` _mouseButtons w)
= rotateToOverlappingWall w
| otherwise = w
rotateToOverlappingWall :: World -> World
@@ -269,7 +271,7 @@ rotateToOverlappingWall w = case theWall of
b' = fromIntegral (round b :: Int)
cr = you w
p = _crPos cr
theWall = overlapCircWallsReturnWall p (_crRad cr + 5) (wallsNearPoint p w)
theWall = overlapCircWallsReturnWall p (_crRad cr + 5) (IM.filter _wlRotateTo $ wallsNearPoint p w)
{-
Finds the IDs of visible walls from a point to another point. -}