mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-26 19:39:31 +00:00
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
@ -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…
x
Reference in New Issue
Block a user