From 43c7a4b3128db3f22569ad2e51c295c9e5dde0fc Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 9 Apr 2016 15:48:41 -0700 Subject: [PATCH] wizard mode enlightenment for "very fast" Fast and Very_fast share the same property index, but from_what() didn't handle that. Enlightenment for a Very_fast hero--which can only happen via worn equipment (speed boots) or timed effect (potion of speed or spell of haste self)--would be erroneously described as "very fast innately" for roles who get intrinsic speed at level 1, or "very fast because of experience" when high enough level for roles who get intrinsic speed later. --- doc/fixes36.1 | 2 ++ src/attrib.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 2225af5ef..4c72bf86d 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -199,6 +199,8 @@ commands invoked by uppercase meta characters: M-A, M-C, M-N, M-O, M-R, M-T were missing from '? c' list of game commands (dat/hh) tweak Baalzebub's lair and clean up the map display for it symbol set definitions didn't recognize S_darkroom and S_vibrating_square +wizard mode enlightenment was reporting "very fast innately" (which is not + possible) for very fast hero who was innately fast post-3.6.0: fix "object lost" panic during pickup caused by sortloot revamp post-3.6.0: more sortloot revisions diff --git a/src/attrib.c b/src/attrib.c index 63ae7269c..d3dcf304a 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -758,6 +758,8 @@ int propidx; /* innately() would report FROM_FORM for this; caller wants specificity */ if (propidx == DRAIN_RES && u.ulycn >= LOW_PM) return FROM_LYCN; + if (propidx == FAST && Very_fast) + return FROM_NONE; /* can't become very fast innately */ if ((innateness = innately(&u.uprops[propidx].intrinsic)) != FROM_NONE) return innateness; if (propidx == JUMPING && Role_if(PM_KNIGHT) @@ -796,6 +798,14 @@ int propidx; /* special cases can have negative values */ Strcpy(buf, " from current creature form"); else if (innateness == FROM_ROLE || innateness == FROM_RACE) Strcpy(buf, " innately"); + else if (propidx == FAST && Very_fast) + Sprintf(buf, because_of, + ((HFast & TIMEOUT) != 0L) ? "a potion or spell" + : ((EFast & W_ARMF) != 0L && uarmf->dknown + && objects[uarmf->otyp].oc_name_known) + ? ysimple_name(uarmf) /* speed boots */ + : EFast ? "worn equipment" + : something); else if (wizard && (obj = what_gives(&u.uprops[propidx].extrinsic)) != 0) Sprintf(buf, because_of, obj->oartifact