Bugfix: vty-rouge: use correct bounds when constructing level geography array

Before this fix, attempts to inspect indices using `levelWidth` and
`levelHeight` would result in a runtime exception.
This commit is contained in:
Jonathan Daugherty 2014-08-01 15:13:34 -07:00
parent da216cb5a5
commit 18ad37af1c

View File

@ -59,7 +59,7 @@ mkLevel difficulty = do
start <- randomP
end <- randomP
-- first the base geography: all rocks
let baseGeo = array ((0,0), (levelWidth, levelHeight))
let baseGeo = array ((0,0), (levelWidth-1, levelHeight-1))
[((x,y),Rock) | x <- [0..levelWidth-1], y <- [0..levelHeight-1]]
-- next the empty spaces that make the rooms
-- for this we generate a number of center points