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

Function e_survives_at

src/dbridge.c:379–399  ·  view source on GitHub ↗

* Simple-minded "can it be here?" routine */

Source from the content-addressed store, hash-verified

377 * Simple-minded "can it be here?" routine
378 */
379staticfn boolean
380e_survives_at(struct entity *etmp, coordxy x, coordxy y)
381{
382 if (noncorporeal(etmp->edata))
383 return TRUE;
384 if (is_pool(x, y))
385 return (boolean) ((is_u(etmp) && (Wwalking || Amphibious || Breathless
386 || Swimming || Flying || Levitation))
387 || is_swimmer(etmp->edata)
388 || is_flyer(etmp->edata)
389 || is_floater(etmp->edata));
390 /* must force call to lava_effects in e_died if is_u */
391 if (is_lava(x, y))
392 return (boolean) ((is_u(etmp) && (Levitation || Flying))
393 || likes_lava(etmp->edata)
394 || is_flyer(etmp->edata));
395 if (is_db_wall(x, y))
396 return (boolean) (is_u(etmp) ? Passes_walls
397 : passes_walls(etmp->edata));
398 return TRUE;
399}
400
401staticfn void
402e_died(

Callers 2

e_diedFunction · 0.85
do_entityFunction · 0.85

Calls 3

is_poolFunction · 0.85
is_lavaFunction · 0.85
is_db_wallFunction · 0.85

Tested by

no test coverage detected