unconsciousness (trunk only)

When testing armor theft by nymph I got a message "you dream that you
hear <something or other>" 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.
This commit is contained in:
nethack.rankin
2012-02-04 07:20:23 +00:00
parent a7aaee910e
commit 9b61b368b4

View File

@@ -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";