| 417 | } |
| 418 | |
| 419 | staticfn boolean |
| 420 | teleok(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 | |
| 447 | void |
| 448 | teleds(coordxy nux, coordxy nuy, int teleds_flags) |
no test coverage detected