status updating: a*.c

I went through the places that set context.botl/botlx in src/a*.c to
see whether I could find any unnecessary status updates.  I didn't
find anything interesting, mostly some minor sequencing issues plus
a couple of redundant sets (call foo() which includes setting botl,
then explicitly set botl after it returns).  If you issue pline first
and then set context.botl, bottom lines won't be updated until the
next message or next pass through moveloop.  If you order those the
other way around, status will be updated as the message describing
the reason for the update is being delivered.
This commit is contained in:
PatR
2019-03-23 10:50:26 -07:00
parent 02bf042ab4
commit c57b32f5fe
4 changed files with 30 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 allmain.c $NHDT-Date: 1539804859 2018/10/17 19:34:19 $ $NHDT-Branch: keni-makedefsm $:$NHDT-Revision: 1.89 $ */
/* NetHack 3.6 allmain.c $NHDT-Date: 1553363414 2019/03/23 17:50:14 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.95 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -181,7 +181,7 @@ boolean resuming;
if (u.ublesscnt)
u.ublesscnt--;
if (flags.time && !context.run)
context.botl = 1;
context.botl = TRUE;
/* One possible result of prayer is healing. Whether or
* not you get healed depends on your current hit points.
@@ -226,7 +226,7 @@ boolean resuming;
(int) (ACURR(A_WIS) + ACURR(A_INT)) / 15 + 1, 1);
if (u.uen > u.uenmax)
u.uen = u.uenmax;
context.botl = 1;
context.botl = TRUE;
if (u.uen == u.uenmax)
interrupt_multi("You feel full of energy.");
}
@@ -405,7 +405,7 @@ boolean resuming;
/* lookaround may clear multi */
context.move = 0;
if (flags.time)
context.botl = 1;
context.botl = TRUE;
continue;
}
if (context.mv) {
@@ -427,7 +427,7 @@ boolean resuming;
deferred_goto(); /* after rhack() */
/* !context.move here: multiple movement command stopped */
else if (flags.time && (!context.move || !context.mv))
context.botl = 1;
context.botl = TRUE;
if (vision_full_recalc)
vision_recalc(0); /* vision! */
@@ -435,7 +435,8 @@ boolean resuming;
if ((!context.run || flags.runmode == RUN_TPORT)
&& (multi && (!context.travel ? !(multi % 7) : !(moves % 7L)))) {
if (flags.time && context.run)
context.botl = 1;
context.botl = TRUE;
/* [should this be flush_screen() instead?] */
display_nhwindow(WIN_MAP, FALSE);
}
}
@@ -465,7 +466,7 @@ int wtcap;
heal = 1;
}
if (heal) {
context.botl = 1;
context.botl = TRUE;
u.mh += heal;
reached_full = (u.mh == u.mhmax);
}
@@ -497,7 +498,7 @@ int wtcap;
heal = 1;
if (heal) {
context.botl = 1;
context.botl = TRUE;
u.uhp += heal;
if (u.uhp > u.uhpmax)
u.uhp = u.uhpmax;
@@ -518,7 +519,7 @@ stop_occupation()
if (!maybe_finished_meal(TRUE))
You("stop %s.", occtxt);
occupation = 0;
context.botl = 1; /* in case u.uhs changed */
context.botl = TRUE; /* in case u.uhs changed */
nomul(0);
pushch(0);
} else if (multi >= 0) {
@@ -571,7 +572,7 @@ newgame()
gameDiskPrompt();
#endif
context.botlx = 1;
context.botlx = TRUE;
context.ident = 1;
context.stethoscope_move = -1L;
context.warnlevel = 1;