revise #wizbury feedback
Simplify the code added in April.
This commit is contained in:
34
src/dig.c
34
src/dig.c
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 dig.c $NHDT-Date: 1709928001 2024/03/08 20:00:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.211 $ */
|
/* NetHack 3.7 dig.c $NHDT-Date: 1724613307 2024/08/25 19:15:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.219 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Michael Allison, 2012. */
|
/*-Copyright (c) Michael Allison, 2012. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -2294,26 +2294,24 @@ wiz_debug_cmd_bury(void)
|
|||||||
++before;
|
++before;
|
||||||
|
|
||||||
bury_objs(x, y);
|
bury_objs(x, y);
|
||||||
|
|
||||||
|
for (otmp = svl.level.objects[x][y]; otmp; otmp = otmp->nexthere)
|
||||||
|
++after;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (before == 0) { /* there was nothing here */
|
diff = before - after;
|
||||||
|
if (before == 0)
|
||||||
|
/* there was nothing here */
|
||||||
pline("No objects here or adjacent to bury.");
|
pline("No objects here or adjacent to bury.");
|
||||||
} else {
|
else if (diff == 0)
|
||||||
for (x = u.ux - 1; x <= u.ux + 1; x++)
|
/* before and after will be the same if only unburiable objects are
|
||||||
for (y = u.uy - 1; y <= u.uy + 1; y++) {
|
present (The Amulet, invocation items, Rider corpses, uchain when
|
||||||
if (!isok(x, y))
|
uball doesn't get buried: carried or floor beyond burial range) */
|
||||||
continue;
|
pline("No objects buried.");
|
||||||
for (otmp = svl.level.objects[x][y]; otmp; otmp = otmp->nexthere)
|
else
|
||||||
++after;
|
/* usual case; if uball got buried, uchain went away and won't be
|
||||||
}
|
counted as buried */
|
||||||
diff = before - after;
|
pline("%d object%s buried.", diff, plur(diff));
|
||||||
/* will be 0 if only unburiable objects (The Amulet, &c) are present;
|
|
||||||
if uball got buried, uchain went away--count that as being buried */
|
|
||||||
if (diff == 0)
|
|
||||||
pline("No objects buried.");
|
|
||||||
else
|
|
||||||
pline("%d object%s buried.", diff, plur(diff));
|
|
||||||
}
|
|
||||||
return ECMD_OK;
|
return ECMD_OK;
|
||||||
}
|
}
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|||||||
Reference in New Issue
Block a user