Add missing termination condition

This commit is contained in:
Charles Peyrat 2021-01-08 07:04:24 +01:00
parent b0ac580677
commit e21d4d230c
1 changed files with 2 additions and 0 deletions

View File

@ -165,6 +165,8 @@ class Generator:
y, x = pos // width, pos % width
if self.room_fits(level, y, x, room, door_y, door_x, dy, dx):
self.place_room(level, y, x, room, door_y, door_x)
rooms_built += 1
tries += 1
# post-processing
self.place_walls(level)