pyskool
pyskool copied to clipboard
Fatal error in Exam Room
Playing skool_daze.py , I got today a rare bug (never caught it before). It happened when Mr Wacker had already told students to sit, and the students were taking their seats. The game exited with no weird symptoms at all (ie: the game window was gone), and the terminal had this log:
ERROR: Character BOY10 (COOK) at (74,12) cannot find a chair because self.room == None
DEBUG: COOK at 74, 12 has no home floor
DEBUG: Cannot determine next staircase when home floor is None
DEBUG: COOK at 74, 12 has no home floor
DEBUG: Cannot determine next staircase when home floor is None
DEBUG: COOK at 73, 12 has no home floor
DEBUG: Cannot determine next staircase when home floor is None
DEBUG: COOK at 72, 12 has no home floor
DEBUG: Cannot determine next staircase when home floor is None
DEBUG: COOK at 71, 12 has no home floor
DEBUG: Cannot determine next staircase when home floor is None
DEBUG: COOK at 70, 12 has no home floor
DEBUG: Cannot determine next staircase when home floor is None
ERROR: Character BOY05 (HARRIS) at (29,3) cannot find a chair because self.room == None
DEBUG: COOK at 69, 12 has no home floor
DEBUG: Cannot determine next staircase when home floor is None
DEBUG: COOK at 68, 12 has no home floor
DEBUG: Cannot determine next staircase when home floor is None
DEBUG: COOK at 67, 12 has no home floor
DEBUG: Cannot determine next staircase when home floor is None
DEBUG: COOK at 66, 12 has no home floor
DEBUG: Cannot determine next staircase when home floor is None
ERROR: Character BOY03 (FANSHAW) at (27,3) cannot find a chair because self.room == None
DEBUG: COOK at 65, 12 has no home floor
DEBUG: Cannot determine next staircase when home floor is None
DEBUG: COOK at 64, 12 has no home floor
DEBUG: Cannot determine next staircase when home floor is None
DEBUG: COOK at 63, 12 has no home floor
DEBUG: Cannot determine next staircase when home floor is None
DEBUG: COOK at 62, 12 has no home floor
DEBUG: Cannot determine next staircase when home floor is None
DEBUG: COOK at 61, 12 has no home floor
DEBUG: Cannot determine next staircase when home floor is None
Traceback (most recent call last):
File "./skool_daze.py", line 24, in <module>
main(os.path.abspath(os.path.dirname(__file__)))
File "/Users/myuser/pyskool/run.py", line 238, in main
game.play()
File "/Users/myuser/pyskool/game.py", line 386, in play
if self._main_loop():
File "/Users/myuser/pyskool/game.py", line 461, in _main_loop
self.scroll = self.skool.move_characters()
File "/Users/myuser/pyskool/skool.py", line 272, in move_characters
return self.cast.move()
File "/Users/myuser/pyskool/cast.py", line 150, in move
movable.move()
File "/Users/myuser/pyskool/character.py", line 1686, in move
self.command_list.command()
File "/Users/myuser/pyskool/ai.py", line 108, in command
subcommand = command.execute()
File "/Users/myuser/pyskool/ai.py", line 576, in execute
if next_staircase.contains(self.character):
AttributeError: 'NoneType' object has no attribute 'contains'
Reading the log, it seems like there's a student with unknown/illegal current location. IMHO, this error shouldn't quit the game, just keep the student paused, or reset the student.