change movement dir if impaired. return TRUE if can't move */
| 2422 | |
| 2423 | /* change movement dir if impaired. return TRUE if can't move */ |
| 2424 | staticfn boolean |
| 2425 | impaired_movement(coordxy *x, coordxy *y) |
| 2426 | { |
| 2427 | if (u_maybe_impaired()) { |
| 2428 | int tries = 0; |
| 2429 | |
| 2430 | do { |
| 2431 | if (tries++ > 50) { |
| 2432 | nomul(0); |
| 2433 | return TRUE; |
| 2434 | } |
| 2435 | confdir(TRUE); |
| 2436 | *x = u.ux + u.dx; |
| 2437 | *y = u.uy + u.dy; |
| 2438 | } while (!isok(*x, *y) || bad_rock(gy.youmonst.data, *x, *y)); |
| 2439 | } |
| 2440 | return FALSE; |
| 2441 | } |
| 2442 | |
| 2443 | staticfn boolean |
| 2444 | avoid_moving_on_trap(coordxy x, coordxy y, boolean msg) |
no test coverage detected