Cleanup warnings
This commit is contained in:
@@ -103,21 +103,19 @@ hasLOSIndirect p1 p2 w = case collidePointIndirect p1 p2 $ wallsAlongLine p1 p2
|
||||
Nothing -> True
|
||||
|
||||
isWalkable :: Point2 -> Point2 -> World -> Bool
|
||||
isWalkable p1 p2 w = not $ collidePointWalkable p1 p2 nearbyWalls
|
||||
where
|
||||
nearbyWalls = wallsAlongLine p1 p2 w
|
||||
isWalkable p1 p2 w = not
|
||||
$ collidePointWalkable p1 p2
|
||||
$ wallsAlongLine p1 p2 w
|
||||
|
||||
canSee :: Int -> Int -> World -> Bool
|
||||
canSee i j w = hasLOS p1 p2 w
|
||||
where
|
||||
p1 = _crPos (_creatures w IM.! i)
|
||||
p2 = _crPos (_creatures w IM.! j)
|
||||
nearbyWalls = wallsAlongLine p1 p2 w
|
||||
|
||||
canSeePoint :: Int -> Point2 -> World -> Bool
|
||||
canSeePoint i p w = hasLOS p1 p w
|
||||
where
|
||||
nearbyWalls = wallsAlongLine p1 p w
|
||||
p1 = _crPos (_creatures w IM.! i)
|
||||
|
||||
pathToPointFireable :: Int -> Point2 -> World -> Bool
|
||||
@@ -133,7 +131,6 @@ canSeePointAll i targPos w
|
||||
= all (flip (canSeePoint i) w . (\p -> targPos +.+ radius *.* p)) [(1,0),(0,1),(-1,0),(0,-1)]
|
||||
where
|
||||
cr = _creatures w IM.! i
|
||||
cpos = _crPos cr
|
||||
radius = _crRad cr
|
||||
|
||||
canSeeAny :: Int -> Int -> World -> Bool
|
||||
|
||||
@@ -10,6 +10,7 @@ screenPolygon w = [tr,tl,bl,br]
|
||||
where
|
||||
scRot = rotateV (_cameraRot w)
|
||||
scZoom p | _cameraZoom w /= 0 = (1/_cameraZoom w) *.* p
|
||||
| otherwise = p
|
||||
scTran p = p +.+ _cameraCenter w
|
||||
tr = scTran $ scRot $ scZoom ( halfWidth w, halfHeight w)
|
||||
tl = scTran $ scRot $ scZoom (-halfWidth w, halfHeight w)
|
||||
@@ -19,6 +20,6 @@ screenPolygon w = [tr,tl,bl,br]
|
||||
halfWidth,halfHeight :: World -> Float
|
||||
halfWidth w = getWindowX w / 2
|
||||
halfHeight w = getWindowY w / 2
|
||||
|
||||
getWindowX ,getWindowY :: World -> Float
|
||||
getWindowX = _windowX . _config
|
||||
getWindowY = _windowY . _config
|
||||
|
||||
Reference in New Issue
Block a user