From bb53b29481035a993a03732b4abf73845cd8f809 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 28 Apr 2026 12:35:39 -0700 Subject: [PATCH 1/2] simplify picking item up while swallowed --- src/pickup.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/pickup.c b/src/pickup.c index 4b5a1c573..5cc2fbcef 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1897,27 +1897,17 @@ struct obj * pick_obj(struct obj *otmp) { struct obj *result; - int ox, oy; - boolean robshop = FALSE; + coordxy ox, oy; + boolean robshop, fromfloor = otmp->where == OBJ_FLOOR; - if (otmp->ox == 0 && otmp->oy == 0) { - if (u.uswallow && u.ustuck && otmp->where == OBJ_MINVENT - && otmp->ocarry == u.ustuck) { - otmp->ox = u.ustuck->mx; - otmp->oy = u.ustuck->my; - } else { - /* this will be a problem for newsym below */ - impossible("otmp has no location coordinates <%d, %d> where=%d.", - otmp->ox, otmp->oy, otmp->where); - } - } + /* otmp is either on the floor or in an engulfer's inventory; for the + latter, its probably won't be set */ + (void) get_obj_location(otmp, &ox, &oy, 0); - ox = otmp->ox; - oy = otmp->oy; robshop = (!u.uswallow && otmp != uball && costly_spot(ox, oy)); - obj_extract_self(otmp); - newsym(ox, oy); + if (fromfloor) + newsym(ox, oy); /* for shop items, addinv() needs to be after addtobill() (so that object merger can take otmp->unpaid into account) but before From ee55f125a007803395a7ed0ce2871acc9460e48b Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 28 Apr 2026 16:03:04 -0400 Subject: [PATCH 2/2] follow-up bit for consoletty.c Limit the #ifdef INSURANCE range to only the function call that requires it. --- sys/windows/consoletty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/windows/consoletty.c b/sys/windows/consoletty.c index 926b4033f..781f85709 100644 --- a/sys/windows/consoletty.c +++ b/sys/windows/consoletty.c @@ -3120,17 +3120,17 @@ default_checkinput( if (dwWait == WAIT_FAILED) return '\033'; #endif -#ifdef INSURANCE if (iflags.idlecheckpoint && dwWait == WAIT_TIMEOUT && !done_a_checkpoint) { /* no input for 30 seconds, so let's take * advantage and do a game checkpoint, * then resume the wait. */ +#ifdef INSURANCE save_currentstate(); +#endif /* INSURANCE */ done_a_checkpoint = TRUE; } else -#endif /* INSURANCE */ { ReadConsoleInput(hConIn, ir, 1, count); if (mode == 0) {