hero_seq followup

Make sure g.hero_seq has a sane value during restore before moveloop()
has a chance to update it.

Have curses use g.hero_seq for messages delivered via putmsghistory().
This commit is contained in:
PatR
2021-12-26 14:40:03 -08:00
parent 9daefde0c4
commit f72ad04266
2 changed files with 34 additions and 9 deletions

View File

@@ -670,8 +670,12 @@ restgamestate(NHFILE* nhfp, unsigned int* stuckid, unsigned int* steedid)
restlevchn(nhfp);
if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) &g.moves, sizeof g.moves);
mread(nhfp->fd, (genericptr_t) &g.quest_status, sizeof (struct q_score));
mread(nhfp->fd, (genericptr_t) g.spl_book, (MAXSPELL + 1) * sizeof (struct spell));
/* hero_seq isn't saved and restored because it can be recalculated */
g.hero_seq = g.moves << 3; /* normally handled in moveloop() */
mread(nhfp->fd, (genericptr_t) &g.quest_status,
sizeof (struct q_score));
mread(nhfp->fd, (genericptr_t) g.spl_book,
(MAXSPELL + 1) * sizeof (struct spell));
}
restore_artifacts(nhfp);
restore_oracles(nhfp);