Fix cave map generator producing passages along the map border

Maps are 0-indexed even in Lua (so that 1 ends up as the lowest passable coordinate), so subtract 1 here

Closes #5407
This commit is contained in:
Celtic Minstrel 2021-02-16 13:46:01 -05:00 committed by GitHub
parent 2a83e78a3c
commit a019edb26c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -122,7 +122,7 @@ function callbacks.generate_map(params)
local width = math.max(v.data.width or 1, 1) local width = math.max(v.data.width or 1, 1)
local jagged = v.data.jagged or 0 local jagged = v.data.jagged or 0
local calc = function(x, y) local calc = function(x, y)
if x == 0 or x == params.map_width or y == 0 or y == params.map_height then if x == 0 or x == params.map_width - 1 or y == 0 or y == params.map_height - 1 then
-- Map borders are impassable -- Map borders are impassable
return math.huge return math.huge
end end