Skip to content

Commit

Permalink
Add a check for no scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
gregcorbett committed Oct 15, 2016
1 parent c3259fc commit 3f5d4dd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/GameWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ def choose_scenario(self):
# Get the available Scenarios (those under ./scenarios/)
scenario_list = glob.glob("./scenarios/*.scibot")

# If no scenarios, exit!
if len(scenario_list) is 0:
print("No scibot files found.")
print("Please place them in ./scenarios/")
self.rendering_mode = RenderingMode.END_RENDERING
sleep(1)
pygame.quit()
sys.exit()

# If only one scenario, use that one!
if len(scenario_list) is 1:
self.scenario = scenario_list[0]
Expand Down

0 comments on commit 3f5d4dd

Please sign in to comment.