if hero is impaired, pick random movement direction */
| 4297 | |
| 4298 | /* if hero is impaired, pick random movement direction */ |
| 4299 | void |
| 4300 | confdir(boolean force_impairment) |
| 4301 | { |
| 4302 | if (force_impairment || u_maybe_impaired()) { |
| 4303 | int kmax = NODIAG(u.umonnum) ? (N_DIRS / 2) : N_DIRS, |
| 4304 | k = (int) dirs_ord[rn2(kmax)]; |
| 4305 | |
| 4306 | u.dx = xdir[k]; |
| 4307 | u.dy = ydir[k]; |
| 4308 | } |
| 4309 | return; |
| 4310 | } |
| 4311 | |
| 4312 | const char * |
| 4313 | directionname(int dir) |
no test coverage detected