trying to move out-of-bounds? */
| 2583 | |
| 2584 | /* trying to move out-of-bounds? */ |
| 2585 | staticfn boolean |
| 2586 | move_out_of_bounds(coordxy x, coordxy y) |
| 2587 | { |
| 2588 | if (!isok(x, y)) { |
| 2589 | if (svc.context.forcefight) |
| 2590 | return domove_fight_empty(x, y); |
| 2591 | |
| 2592 | if (flags.mention_walls) { |
| 2593 | coordxy dx = u.dx, dy = u.dy; |
| 2594 | |
| 2595 | if (dx && dy) { /* diagonal */ |
| 2596 | /* only as far as possible diagonally if in very |
| 2597 | corner; otherwise just report whichever of the |
| 2598 | cardinal directions has reached its limit */ |
| 2599 | if (isok(x, u.uy)) |
| 2600 | dx = 0; |
| 2601 | else if (isok(u.ux, y)) |
| 2602 | dy = 0; |
| 2603 | } |
| 2604 | You("have already gone as far %s as possible.", |
| 2605 | directionname(xytodir(dx, dy))); |
| 2606 | } |
| 2607 | nomul(0); |
| 2608 | svc.context.move = 0; |
| 2609 | return TRUE; |
| 2610 | } |
| 2611 | return FALSE; |
| 2612 | } |
| 2613 | |
| 2614 | /* carrying too much to be able to move? */ |
| 2615 | staticfn boolean |
no test coverage detected