MCPcopy Create free account
hub / github.com/NetHack/NetHack / check_in_air

Function check_in_air

src/trap.c:1085–1094  ·  view source on GitHub ↗

return TRUE if monster mtmp is up in the air, considering trap flags */

Source from the content-addressed store, hash-verified

1083
1084/* return TRUE if monster mtmp is up in the air, considering trap flags */
1085staticfn boolean
1086check_in_air(struct monst *mtmp, unsigned trflags)
1087{
1088 boolean is_you = mtmp == &gy.youmonst,
1089 plunged = (trflags & (TOOKPLUNGE | VIASITTING)) != 0;
1090
1091 return ((trflags & HURTLING) != 0
1092 || (is_you ? Levitation : is_floater(mtmp->data))
1093 || ((is_you ? Flying : is_flyer(mtmp->data)) && !plunged));
1094}
1095
1096/* return TRUE if mtmp is wearing shoes made of iron (iron/kicking) */
1097boolean

Callers 3

m_harmless_trapFunction · 0.85
dotrapFunction · 0.85
mintrapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected