MCPcopy Index your code
hub / github.com/NetHack/NetHack / fall_asleep

Function fall_asleep

src/timeout.c:950–974  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

948}
949
950void
951fall_asleep(int how_long, boolean wakeup_msg)
952{
953 stop_occupation();
954 nomul(how_long);
955 gm.multi_reason = "sleeping";
956#if 0 /* this was broken; the fix for 'how_long' will result in changed
957 * behavior for sounds that don't go through You_hear() so needs
958 * testing */
959 /* You_hear() produces "You dream that you hear ..." when sleeping;
960 other sound messages will either honor or ignore Deaf */
961 if (wakeup_msg && gm.multi == how_long) {
962 /* caller can follow with a direct call to Hear_again() if
963 there's a need to override this when wakeup_msg is true */
964 /* 5.0: how_long is negative so wasn't actually incrementing the
965 deafness timeout when it used to be passed as-is */
966 incr_itimeout(&HDeaf, abs(how_long));
967 disp.botl = TRUE;
968 ga.afternmv = Hear_again; /* this won't give any messages */
969 }
970#endif
971 /* early wakeup from combat won't be possible until next monster turn */
972 u.usleep = svm.moves;
973 gn.nomovemsg = wakeup_msg ? "You wake up." : You_can_move_again;
974}
975
976/* Attach an egg hatch timeout to the given egg.
977 * when = Time to hatch, usually only passed if re-creating an

Callers 10

peffect_sleepingFunction · 0.85
mhitm_ad_sleeFunction · 0.85
overexert_hpFunction · 0.85
nh_timeoutFunction · 0.85
fpostfxFunction · 0.85
trapeffect_slp_gas_trapFunction · 0.85
zapyourselfFunction · 0.85
zhituFunction · 0.85
study_bookFunction · 0.85
gazemuFunction · 0.85

Calls 3

stop_occupationFunction · 0.85
nomulFunction · 0.85
incr_itimeoutFunction · 0.85

Tested by

no test coverage detected