ensure tmp_at() structures are initialized for all code paths when swallowed

This commit is contained in:
nhmall
2018-10-04 22:02:28 -04:00
parent 8ce1f88f53
commit c6a5ec1ab6
2 changed files with 16 additions and 5 deletions
+1
View File
@@ -169,6 +169,7 @@ sortloot segfaulted when filtering a subset of items (seen with 'A' command)
orctown: prevent Bad fruit #0 and some minor tuning orctown: prevent Bad fruit #0 and some minor tuning
make long extended commands list be more navigable make long extended commands list be more navigable
simplify #wizidentify; don't rely on having bold menu entries simplify #wizidentify; don't rely on having bold menu entries
ensure tmp_at() structures are initialized for all code paths when swallowed
tty: turn off an optimization that is the suspected cause of Windows reported tty: turn off an optimization that is the suspected cause of Windows reported
partial status lines following level changes partial status lines following level changes
tty: ensure that current status fields are always copied to prior status tty: ensure that current status fields are always copied to prior status
+15 -5
View File
@@ -1134,6 +1134,8 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
mon = u.ustuck; mon = u.ustuck;
bhitpos.x = mon->mx; bhitpos.x = mon->mx;
bhitpos.y = mon->my; bhitpos.y = mon->my;
if (tethered_weapon)
tmp_at(DISP_TETHER, obj_to_glyph(obj));
} else if (u.dz) { } else if (u.dz) {
if (u.dz < 0 if (u.dz < 0
/* Mjollnir must we wielded to be thrown--caller verifies this; /* Mjollnir must we wielded to be thrown--caller verifies this;
@@ -1280,12 +1282,20 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
/* missile has already been handled */ /* missile has already been handled */
if (tethered_weapon) tmp_at(DISP_END, 0); if (tethered_weapon) tmp_at(DISP_END, 0);
} else if (u.uswallow) { } else if (u.uswallow) {
if (tethered_weapon) if (tethered_weapon) {
tmp_at(DISP_END, 0); tmp_at(DISP_END, 0);
/* ball is not picked up by monster */ pline("%s returns to your hand!", The(xname(thrownobj)));
if (obj != uball) thrownobj = addinv(thrownobj);
(void) mpickobj(u.ustuck, obj); (void) encumber_msg();
thrownobj = (struct obj *) 0; if (thrownobj->owornmask & W_QUIVER) /* in case addinv() autoquivered */
setuqwep((struct obj *) 0);
setuwep(thrownobj);
} else {
/* ball is not picked up by monster */
if (obj != uball)
(void) mpickobj(u.ustuck, obj);
thrownobj = (struct obj *) 0;
}
} else { } else {
/* Mjollnir must we wielded to be thrown--caller verifies this; /* Mjollnir must we wielded to be thrown--caller verifies this;
aklys must we wielded as primary to return when thrown */ aklys must we wielded as primary to return when thrown */