Skip to content

Commit

Permalink
Avoid map borders in cave generator
Browse files Browse the repository at this point in the history
Addresses #5407
  • Loading branch information
CelticMinstrel committed Feb 15, 2021
1 parent aef55dc commit 438b661
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions data/lua/cave_map_generator.lua
Expand Up @@ -122,6 +122,10 @@ 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
-- Map borders are impassable
return math.huge
end
local res = 1.0
if map:get_tile(x, y) == params.terrain_wall then
res = laziness
Expand Down

0 comments on commit 438b661

Please sign in to comment.