| 1 | Downloaded from https://anonscm.debian.org/viewvc/pkg-games/packages/trunk/kiki-the-nano-bot/debian/patches/level-selection-with-no-levels-solved.patch?revision=8291&view=co |
| 2 | |
| 3 | Kiki crashes if the user tries to use the level selection menu before |
| 4 | finishing any level. |
| 5 | |
| 6 | Peter De Wachter (pdewacht@gmail.com) |
| 7 | placed in the public domain |
| 8 | |
| 9 | --- a/py/levelselection.py |
| 10 | +++ b/py/levelselection.py |
| 11 | @@ -25,6 +25,8 @@ |
| 12 | # ............................................................................................................ \r |
| 13 | \r |
| 14 | last_level = highscore.getLastAvailableLevel()\r |
| 15 | + if last_level < 0:\r |
| 16 | + last_level = 0\r |
| 17 | current_level = (level_index >= 0) and level_index or last_level \r |
| 18 | \r |
| 19 | world.max_level_index = last_level\r |