Circular rooms should not try to generate any holes if their radius isn't large enough

This commit is contained in:
Charles Peyrat 2021-01-08 04:51:20 +01:00
parent c6f66d95f2
commit 05ccd0e339
1 changed files with 3 additions and 3 deletions

View File

@ -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):