From 8a85f1d92c19751195bcfc790637b8c23a0073ca Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 22 Apr 2023 18:38:33 +0300 Subject: [PATCH] Fix minetn-6 map generation errors Two error cases with the map generation in minetn-6: first one was the lregion placement impossible, caused by randomly generated mines not going past the map either left or right, and the stair generation being restricted outside the fixed map. second was one side of the map being unreachable, because the mines layout joined to the other side right at the edge of map behind the small room with the "x" mapchars. --- dat/minetn-6.lua | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/dat/minetn-6.lua b/dat/minetn-6.lua index 9a3fdaab4..a31d9fcd8 100644 --- a/dat/minetn-6.lua +++ b/dat/minetn-6.lua @@ -24,24 +24,28 @@ x------xxxxxxxxxxxxxx-----------------xx .|...+..--+--.........|...|..|...|...|.. .|...|..|...|..-----..|...|..|-+---+--.. .-----..|...|--|...|..--+---+-.........x -........|...|..|...+.............-----.. +........|...|..|...+.............-----.x ........-----..|...|......--+-...|...|.. x----...|...|+------..{...|..|...+...|.. x|..+...|...|.............|..|...|...|.. -x|..|...|...|-+-.....---+-------------.x -x----...--+--..|..-+-|.................. -...|........|..|..|..|----....--------x. -...|..T.....----..|..|...+....|......|x. +.|..|...|...|-+-.....---+-------------.x +.----...--+--..|..-+-|.................. +...|........|..|..|..|----....--------.x +...|..T.....----..|..|...+....|......|.. ...|-....{........|..|...|....+......|x. ...--..-....T.....--------....|......|x. .......--.....................---------- -xxxxx-----xxxxxxxxxxxxxxxxxx------------ +.xxxx-----xxxxxxxxxxxxxxxxxx------------ xxxx-------xxxxxxxxxxxxxxx-------------- ]] }); des.region(selection.area(00,00,39,19),"lit") -des.levregion({ type="stair-up", region={01,03,20,19}, region_islev=1, exclude={0,0,39,19} }) -des.levregion({ type="stair-down", region={61,03,75,19}, region_islev=1, exclude={0,0,39,19} }) + +-- stairs can generate 1 column left or right inside the map, +-- in case the randomly generated mines layout doesn't extend outside the map +des.levregion({ type="stair-up", region={01,03,21,19}, region_islev=1, exclude={1,0,39,18} }) +des.levregion({ type="stair-down", region={60,03,75,19}, region_islev=1, exclude={0,0,38,18} }) + des.region(selection.area(13,7,14,8),"unlit") des.region({ region={09,09, 11,11}, lit=1, type="candle shop", filled=1 }) des.region({ region={16,06, 18,08}, lit=1, type="tool shop", filled=1 })