latitudegames / AIDungeon

Infinite adventures await!
http://www.aidungeon.io/
MIT License
3.18k stars 556 forks source link

[BUG] Game crashes upon restarting story #172

Closed Audixas closed 4 years ago

Audixas commented 4 years ago

🐛 Bug Report

Describe the bug Game crashes completely upon restarting a story by either ending it or using the /restart command.

How to Reproduce

  1. Start a story as normal
  2. Either end a game or use /restart so that it asks you to rate the story
  3. Game crashes

Expected behavior It is expected that the game would let you restart with a new story normally.

Additional context

kik4444 commented 4 years ago

Does it also crash when you do /save

Audixas commented 4 years ago

/save does not crash the game.

snarfblam commented 4 years ago

Happens consistently

Traceback (most recent call last):
  File "play.py", line 292, in <module>
    play_aidungeon_2()
  File "play.py", line 127, in play_aidungeon_2
    while story_manager.story is None: 
AttributeError: 'UnconstrainedStoryManager' object has no attribute 'story'
marktaiwan commented 4 years ago

It's due to https://github.com/AIDungeon/AIDungeon/blob/f158fa08cdc8b381e0fd806d24dbc2151e65a1d8/play.py#L128-L129 deleting the story attribute, leading to the error when the loop immediately after tries to access it. Change it to something like story_manager.story = None should fix it.

JushBJJ commented 4 years ago

happens to me aswell image

Audixas commented 4 years ago

Latest commits have fixed the issue, restarting now works as intended.