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:
parent
2a83e78a3c
commit
a019edb26c
1 changed files with 1 additions and 1 deletions
|
@ -122,7 +122,7 @@ function callbacks.generate_map(params)
|
|||
local width = math.max(v.data.width or 1, 1)
|
||||
local jagged = v.data.jagged or 0
|
||||
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
|
||||
return math.huge
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue