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

Function set_entity

src/dbridge.c:329–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327}
328
329staticfn void
330set_entity(
331 coordxy x, coordxy y, /* location of span or portcullis */
332 struct entity *etmp) /* pointer to occupants[0] or occupants[1] */
333{
334 if (u_at(x, y))
335 u_to_e(etmp);
336 else /* m_at() might yield Null; that's ok */
337 m_to_e(m_at(x, y), x, y, etmp);
338}
339
340#define is_u(etmp) (etmp->emon == &gy.youmonst)
341#define e_canseemon(etmp) (is_u(etmp) || canseemon(etmp->emon))

Callers 3

close_drawbridgeFunction · 0.85
open_drawbridgeFunction · 0.85
destroy_drawbridgeFunction · 0.85

Calls 2

u_to_eFunction · 0.85
m_to_eFunction · 0.85

Tested by

no test coverage detected