clear "next" from "next boulder" sooner

Clear "next" boulder so that when pushing a pile of boulders, only
the first message for each of the 2nd, 3rd, &c will be formatted as
"next boulder".  If any of them trigger additional messages, those
messages will use normal "boulder".
This commit is contained in:
PatR
2025-01-21 14:55:05 -08:00
parent 61f969e88b
commit 2c1f2c1cb1
3 changed files with 9 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 mkobj.c $NHDT-Date: 1725138481 2024/08/31 21:08:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.304 $ */
/* NetHack 3.7 mkobj.c $NHDT-Date: 1737528890 2025/01/21 22:54:50 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.315 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2673,6 +2673,8 @@ container_weight(struct obj *object)
void
dealloc_obj(struct obj *obj)
{
if (obj->otyp == BOULDER)
obj->next_boulder = 0;
if (obj->where == OBJ_DELETED) {
impossible("dealloc_obj: obj already deleted (type=%d)", obj->otyp);
return;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 objnam.c $NHDT-Date: 1732979463 2024/11/30 07:11:03 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.439 $ */
/* NetHack 3.7 objnam.c $NHDT-Date: 1737528848 2025/01/21 22:54:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.444 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -810,6 +810,9 @@ xname_flags(
more robust because the default value for that overloaded
field (obj->corpsenm) is NON_PM (-1) rather than 0 */
Strcat(strcpy(buf, "next "), actualn); /* "next boulder" */
/* once "next boulder" occurs, subsequent messages should just
use ordinary "boulder" */
obj->next_boulder = 0;
} else {
Strcpy(buf, actualn); /* "boulder" or "statue" */
}

View File

@@ -1131,6 +1131,8 @@ obfree(struct obj *obj, struct obj *merge)
delete_contents(obj);
if (Is_container(obj))
maybe_reset_pick(obj);
if (obj->otyp == BOULDER)
obj->next_boulder = 0;
shkp = 0;
if (obj->unpaid) {