streamlined status update for 'time'

When the 'time' option is on and context.botl isn't already set,
call a simpler status update routine that ignores all other fields.
When that flag is already set, full status update takes care of time
along with the other fields.

Expected to reduce bottom lines processing time but not screen I/O.
Only lightly tested.
This commit is contained in:
PatR
2019-03-31 08:23:36 -07:00
parent c8fdb040cb
commit 0a847f46f9
7 changed files with 61 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
/* 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 $ */
/* NetHack 3.6 allmain.c $NHDT-Date: 1554045808 2019/03/31 15:23:28 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.96 $ */
/* 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 = TRUE;
iflags.time_botl = TRUE;
/* One possible result of prayer is healing. Whether or
* not you get healed depends on your current hit points.
@@ -207,8 +207,10 @@ boolean resuming;
: moves % 10)) {
if (Upolyd && u.mh > 1) {
u.mh--;
context.botl = TRUE;
} else if (!Upolyd && u.uhp > 1) {
u.uhp--;
context.botl = TRUE;
} else {
You("pass out from exertion!");
exercise(A_CON, FALSE);
@@ -234,6 +236,7 @@ boolean resuming;
if (!u.uinvulnerable) {
if (Teleportation && !rn2(85)) {
xchar old_ux = u.ux, old_uy = u.uy;
tele();
if (u.ux != old_ux || u.uy != old_uy) {
if (!next_to_u()) {
@@ -356,6 +359,9 @@ boolean resuming;
if (context.botl || context.botlx) {
bot();
curs_on_u();
} else if (iflags.time_botl) {
timebot();
curs_on_u();
}
context.move = 1;