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:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 apply.c $NHDT-Date: 1544442708 2018/12/10 11:51:48 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.269 $ */
|
||||
/* NetHack 3.6 apply.c $NHDT-Date: 1553363415 2019/03/23 17:50:15 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.272 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1922,7 +1922,6 @@ struct obj *obj;
|
||||
if (Deaf) /* make_deaf() won't give feedback when already deaf */
|
||||
pline("Nothing seems to happen.");
|
||||
make_deaf((HDeaf & TIMEOUT) + lcount, TRUE);
|
||||
context.botl = TRUE;
|
||||
break;
|
||||
}
|
||||
return;
|
||||
@@ -2049,6 +2048,8 @@ struct obj *obj;
|
||||
}
|
||||
}
|
||||
|
||||
if (did_attr || did_prop)
|
||||
context.botl = TRUE;
|
||||
if (did_attr)
|
||||
pline("This makes you feel %s!",
|
||||
(did_prop + did_attr) == (trouble_count + unfixable_trbl)
|
||||
@@ -2057,7 +2058,6 @@ struct obj *obj;
|
||||
else if (!did_prop)
|
||||
pline("Nothing seems to happen.");
|
||||
|
||||
context.botl = (did_attr || did_prop);
|
||||
#undef PROP_COUNT
|
||||
#undef ATTR_COUNT
|
||||
#undef prop2trbl
|
||||
@@ -2687,7 +2687,6 @@ struct obj *obj;
|
||||
You("hit your %s with your bullwhip.", body_part(FOOT));
|
||||
Sprintf(buf, "killed %sself with %s bullwhip", uhim(), uhis());
|
||||
losehp(Maybe_Half_Phys(dam), buf, NO_KILLER_PREFIX);
|
||||
context.botl = 1;
|
||||
return 1;
|
||||
|
||||
} else if ((Fumbling || Glib) && !rn2(5)) {
|
||||
|
||||
Reference in New Issue
Block a user