From 05ccd0e33976ec691e91ad86c5a36aac4d48353f Mon Sep 17 00:00:00 2001 From: Charles Peyrat Date: Fri, 8 Jan 2021 04:51:20 +0100 Subject: [PATCH] Circular rooms should not try to generate any holes if their radius isn't large enough --- squirrelbattle/mapgeneration/broguelike.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/squirrelbattle/mapgeneration/broguelike.py b/squirrelbattle/mapgeneration/broguelike.py index 52ec246..c208e91 100644 --- a/squirrelbattle/mapgeneration/broguelike.py +++ b/squirrelbattle/mapgeneration/broguelike.py @@ -108,9 +108,9 @@ class Generator: def create_circular_room(self): if random() < self.params["large_circular_room"]: - r = randint(5, 10)**2 + r = randint(5, 10) else: - r = randint(2, 4)**2 + r = randint(2, 4) room = [] @@ -118,7 +118,7 @@ class Generator: height = 2*r+2 width = 2*r+2 - make_hole = random() < self.params["circular_holes"] + make_hole = r > 6 and random() < self.params["circular_holes"] if make_hole: r2 = randint(3, r-3) for i in range(height+h_sup):