Circular rooms should not try to generate any holes if their radius isn't large enough
This commit is contained in:
parent
c6f66d95f2
commit
05ccd0e339
|
@ -108,9 +108,9 @@ class Generator:
|
||||||
|
|
||||||
def create_circular_room(self):
|
def create_circular_room(self):
|
||||||
if random() < self.params["large_circular_room"]:
|
if random() < self.params["large_circular_room"]:
|
||||||
r = randint(5, 10)**2
|
r = randint(5, 10)
|
||||||
else:
|
else:
|
||||||
r = randint(2, 4)**2
|
r = randint(2, 4)
|
||||||
|
|
||||||
room = []
|
room = []
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ class Generator:
|
||||||
|
|
||||||
height = 2*r+2
|
height = 2*r+2
|
||||||
width = 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:
|
if make_hole:
|
||||||
r2 = randint(3, r-3)
|
r2 = randint(3, r-3)
|
||||||
for i in range(height+h_sup):
|
for i in range(height+h_sup):
|
||||||
|
|
Loading…
Reference in New Issue