about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2013-04-02 02:04:37 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2013-04-02 02:04:37 -0400
commitcb5f5ff553e7fb8f17c3df05b704bf796a970cc8 (patch)
tree3bc8a568718386a73ed0527e2568aec7c18f50a3
parent94fc90c32fb9d6694a95a9c191553aa39eabd10a (diff)
downloadfallen-hs-master.tar.gz
fallen-hs-master.tar.bz2
fallen-hs-master.zip
Fixed bug where Fallen.Map.legalMoves would allow moving off the edge of the map HEAD master
-rw-r--r--Fallen/Map.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Fallen/Map.hs b/Fallen/Map.hs index a33b696..6e15aed 100644 --- a/Fallen/Map.hs +++ b/Fallen/Map.hs
@@ -46,7 +46,7 @@ module Fallen.Map
46 -- legalMoves :: Map -> Point -> [Tile] -> [Direction] 46 -- legalMoves :: Map -> Point -> [Tile] -> [Direction]
47 legalMoves m p ts = map fst $ filter legal $ map tileDir directions where 47 legalMoves m p ts = map fst $ filter legal $ map tileDir directions where
48 tileDir d = (d, getTileAtPos m $ stepInDirection p d) 48 tileDir d = (d, getTileAtPos m $ stepInDirection p d)
49 legal (_,t) = t `elem` ts 49 legal (d,t) = (t `elem` ts) && (inBounds m $ stepInDirection p d)
50 50
51 -- fillMapRect :: Int -> Int -> Int -> Int -> Tile -> Map -> Map 51 -- fillMapRect :: Int -> Int -> Int -> Int -> Tile -> Map -> Map
52 fillMapRect x y w h t (Map d xs bg) = if bg == t 52 fillMapRect x y w h t (Map d xs bg) = if bg == t