u.uswallow

Make sure u.uswallow is cleared when u.ustuck gets set to Null so
that they won't be out of sync with each other.  Having u.uswallow
be non-zero does imply that u.ustuck is non-Null.

Running #panic while swallowed didn't produce any anomalies for me,
either before or after this change.
This commit is contained in:
PatR
2022-08-15 10:53:50 -07:00
parent b07fe59b3c
commit be0def37c1
4 changed files with 14 additions and 12 deletions

View File

@@ -183,7 +183,7 @@ dosave0(void)
/* these pointers are no longer valid, and at least u.usteed
* may mislead place_monster() on other levels
*/
set_ustuck((struct monst *) 0);
set_ustuck((struct monst *) 0); /* also clears u.uswallow */
u.usteed = (struct monst *) 0;
for (ltmp = (xint8) 1; ltmp <= maxledgerno(); ltmp++) {