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

Function teleok

src/teleport.c:419–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417}
418
419staticfn boolean
420teleok(coordxy x, coordxy y, boolean trapok)
421{
422 if (!trapok) {
423 /* allow teleportation onto vibrating square, it's not a real trap;
424 also allow pits and holes if levitating or flying */
425 struct trap *trap = t_at(x, y);
426
427 if (!trap)
428 trapok = TRUE;
429 else if (trap->ttyp == VIBRATING_SQUARE)
430 trapok = TRUE;
431 else if ((is_pit(trap->ttyp) || is_hole(trap->ttyp))
432 && (Levitation || Flying))
433 trapok = TRUE;
434
435 if (!trapok)
436 return FALSE;
437 }
438 if (!goodpos(x, y, &gy.youmonst, 0))
439 return FALSE;
440 if (!tele_jump_ok(u.ux, u.uy, x, y))
441 return FALSE;
442 if (!in_out_region(x, y))
443 return FALSE;
444 return TRUE;
445}
446
447void
448teleds(coordxy nux, coordxy nuy, int teleds_flags)

Callers 4

safe_teledsFunction · 0.85
vault_teleFunction · 0.85
tele_to_rnd_petFunction · 0.85
scrollteleFunction · 0.85

Calls 4

t_atFunction · 0.85
goodposFunction · 0.85
tele_jump_okFunction · 0.85
in_out_regionFunction · 0.85

Tested by

no test coverage detected