From: nethack.rankin Date: Sat, 4 Feb 2012 07:20:23 +0000 (+0000) Subject: unconsciousness (trunk only) X-Git-Tag: MOVE2GIT~60 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b61b368b4ba927bd5aa13533481d72639953ebe;p=nethack 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. --- 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";