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

Function obstructed

src/lock.c:925–953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

923}
924
925staticfn boolean
926obstructed(coordxy x, coordxy y, boolean quietly)
927{
928 struct monst *mtmp = m_at(x, y);
929
930 if (mtmp && M_AP_TYPE(mtmp) != M_AP_FURNITURE) {
931 if (M_AP_TYPE(mtmp) == M_AP_OBJECT)
932 goto objhere;
933 if (!quietly) {
934 char *Mn = Some_Monnam(mtmp); /* Monnam, Someone or Something */
935
936 if ((mtmp->mx != x || mtmp->my != y) && canspotmon(mtmp))
937 /* s_suffix() returns a modifiable buffer */
938 Mn = strcat(s_suffix(Mn), " tail");
939
940 pline("%s blocks the way!", Mn);
941 }
942 if (!canspotmon(mtmp))
943 map_invisible(x, y);
944 return TRUE;
945 }
946 if (OBJ_AT(x, y)) {
947 objhere:
948 if (!quietly)
949 pline("%s's in the way.", Something);
950 return TRUE;
951 }
952 return FALSE;
953}
954
955/* the #close command - try to close a door */
956int

Callers 2

docloseFunction · 0.85
doorlockFunction · 0.85

Calls 4

Some_MonnamFunction · 0.85
s_suffixFunction · 0.85
map_invisibleFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected