From 9b61b368b4ba927bd5aa13533481d72639953ebe Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 4 Feb 2012 07:20:23 +0000 Subject: [PATCH] unconsciousness (trunk only) When testing armor theft by nymph I got a message "you dream that you hear " even though I was awake. steal() was leaving nomovemsg null in order to get the default of "you can move again", but unconscious() was treating null value as 'yes, hero is unconscious'. I'm pretty sure its intent was just to guard against passing null to strncmpi() and didn't really mean that null indicates unconsciousness. --- src/trap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/trap.c b/src/trap.c index 726298a5a..ce41423de 100644 --- a/src/trap.c +++ b/src/trap.c @@ -4665,11 +4665,11 @@ boolean nocorpse; boolean unconscious() { - return((boolean)(multi < 0 && (!nomovemsg || - u.usleep || - !strncmp(nomovemsg,"You awake", 9) || - !strncmp(nomovemsg,"You regain con", 14) || - !strncmp(nomovemsg,"You are consci", 14)))); + return (boolean)(multi < 0 && + (u.usleep || (nomovemsg && + (!strncmp(nomovemsg, "You awake", 9) || + !strncmp(nomovemsg, "You regain con", 14) || + !strncmp(nomovemsg, "You are consci", 14))))); } static const char lava_killer[] = "molten lava";