mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-12-01 22:53:37 +03:00
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:
parent
da216cb5a5
commit
18ad37af1c
@ -59,7 +59,7 @@ mkLevel difficulty = do
|
|||||||
start <- randomP
|
start <- randomP
|
||||||
end <- randomP
|
end <- randomP
|
||||||
-- first the base geography: all rocks
|
-- 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]]
|
[((x,y),Rock) | x <- [0..levelWidth-1], y <- [0..levelHeight-1]]
|
||||||
-- next the empty spaces that make the rooms
|
-- next the empty spaces that make the rooms
|
||||||
-- for this we generate a number of center points
|
-- for this we generate a number of center points
|
||||||
|
Loading…
Reference in New Issue
Block a user