fix #H7667 - maybe_reset_pick(), other bad context
When deciding whether to discard interrupted lock/unlock context while changing levels, maybe_reset_pick() checks whether xlock.box is being carried. But it was doing so after the old level had been saved and memory for non-carried container there had been freed. That led to a couple of other issues. context.travelcc was using -1 for 'no cached value', but the fields of travelcc have type 'xchar' and shouldn't be given negative values. 0 should be fine for 'no cache'. Failed partial restore which occurred after old game's context had been loaded would begin a new game with old game's stale context. Restoring goes out of its way to avoid that for 'flags' but didn't for 'context'.
This commit is contained in:
@@ -238,6 +238,10 @@ glowing Sting quivers if hero becomes blind and quivering Sting glows if
|
||||
blindness ends; it worked for timed blindness but not for blindfold
|
||||
weapon (wielded pie, egg, potion, boomerang) might be destroyed when hitting a
|
||||
long worm, then freed memory was accessed to decide whether to cut it
|
||||
level change after being interruped locking or unlocking a container might
|
||||
access freed memory
|
||||
if a restore attempt failed and a new game was started instead, it would use
|
||||
stale context from old game if restoration got far enough to load that
|
||||
|
||||
|
||||
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
||||
|
||||
Reference in New Issue
Block a user