dewitters / MysticMine

MIT License
76 stars 23 forks source link

Avoid a crash after the first diamond level. #17

Closed bentley closed 8 years ago

bentley commented 8 years ago

I got this crash after completing the first diamond level:

Unexpected error: <type 'exceptions.TypeError'>
Traceback (most recent call last):
  File "/usr/local/bin/MysticMine", line 11, in <module>
    monorail.monorail.main()
  File "/usr/local/lib/python2.7/site-packages/monorail/monorail.py", line 540, in main
    app.run()
  File "/usr/local/lib/python2.7/site-packages/monorail/koon/app.py", line 81, in run
    self.do_tick( self.userinput )
  File "/usr/local/lib/python2.7/site-packages/monorail/monorail.py", line 139, in do_tick
    self.menu.show_level_select()
  File "/usr/local/lib/python2.7/site-packages/monorail/menu.py", line 66, in show_level_select
    self.screen = ScreenLevelSelect( self.game_data )
  File "/usr/local/lib/python2.7/site-packages/monorail/menu.py", line 783, in __init__
    self.scenario = self.game_data.get_quest().create_scenario(self.game_data.skill_level.value)
  File "/usr/local/lib/python2.7/site-packages/monorail/scenarios.py", line 806, in create_scenario
    scenario.goal = int(scenario.goal * skill)
TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'

With this commit it goes away.