(0014909)
kittel (reporter)
2011-09-28 21:39
|
Hi there,
I am not an expert, but this is what I found after confirming the issue on linux:
1) The reason for the crash is due to a screen update is triggered after the magic user gets a new spell assigned at startup, which triggers a call to get_skill_progress at a point where the skill level has been assigned but before the skill points have been assigned (=> flawed calculations => assert).
2) This early screen update only happens when crawl_state.need_save==true (see the redraw_screen code in stuff.cc), which it is after quitting from a tutorial but not when quitting from e.g. a normal game.
3) The reason the value is different when quitting from a tutorial rather than a normal game can be found in ouch.cc in the ouch(...) function. Here the line which sets crawl_state.need_save=false comes after an " if (crawl_state.game_is_tutorial()) { ... screen_end_game(""); } which actually returns from the function via an exception.
For what is the correct solution, I guess an experienced crawl developer knows better than me, but I tested that it seemed to work if one either put crawl_state.need_save=false inside ouch(..) just before the call to screen_end_game(), or if one put the line in _reset_game() in main.cc.
Hope it helps.
Cheers,
Thomas |