when running/rushing, avoid stepping on a known trap or pool of liquid. returns TRUE if avoided. */
| 2492 | /* when running/rushing, avoid stepping on a known trap or pool of liquid. |
| 2493 | returns TRUE if avoided. */ |
| 2494 | staticfn boolean |
| 2495 | avoid_running_into_trap_or_liquid(coordxy x, coordxy y) |
| 2496 | { |
| 2497 | boolean would_stop = (svc.context.run >= 2); |
| 2498 | if (!svc.context.run) |
| 2499 | return FALSE; |
| 2500 | |
| 2501 | if (avoid_moving_on_trap(x,y, would_stop) |
| 2502 | || (Blind && avoid_moving_on_liquid(x,y, would_stop))) { |
| 2503 | nomul(0); |
| 2504 | if (would_stop) |
| 2505 | svc.context.move = 0; |
| 2506 | return would_stop; |
| 2507 | } |
| 2508 | return FALSE; |
| 2509 | } |
| 2510 | |
| 2511 | /* if paranoid_confirm:Trap is enabled, check whether the next step forward |
| 2512 | needs player confirmation due to visible region or discovered trap; |
no test coverage detected