From 069855eefce5771e6b4ee95ef92d1282c2835a45 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 10 Nov 2023 09:38:40 -0800 Subject: [PATCH] yet more #1112 - slippery hands vs sink Fake object used for 'hands' has an address, so checking for a Null pointer won't recognize it. --- src/fountain.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fountain.c b/src/fountain.c index 31f937b5b..398212085 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -704,16 +704,17 @@ void dipsink(struct obj *obj) { boolean try_call = FALSE, - not_looted_yet = (levl[u.ux][u.uy].looted & S_LRING) == 0; + not_looted_yet = (levl[u.ux][u.uy].looted & S_LRING) == 0, + is_hands = (obj == &gi.invalid_obj || (uarmg && obj == uarmg)); if (!rn2(not_looted_yet ? 25 : 15)) { /* can't rely on using sink for unlimited scroll blanking; however, since sink will be converted into a fountain, hero can dip again */ breaksink(u.ux, u.uy); /* "The pipes break! Water spurts out!" */ - if (Glib && (!obj || obj == uarmg)) + if (Glib && is_hands) Your("%s are still slippery.", fingers_or_gloves(TRUE)); return; - } else if (obj == &gi.invalid_obj || obj == uarmg) { + } else if (is_hands) { (void) wash_hands(); return; } else if (obj->oclass != POTION_CLASS) {