find "bottom" level of specified dungeon, stopping at quest locate */
| 415 | |
| 416 | /* find "bottom" level of specified dungeon, stopping at quest locate */ |
| 417 | staticfn int |
| 418 | dng_bottom(d_level *lev) |
| 419 | { |
| 420 | int bottom = dunlevs_in_dungeon(lev); |
| 421 | |
| 422 | /* when in the upper half of the quest, don't fall past the |
| 423 | middle "quest locate" level if hero hasn't been there yet */ |
| 424 | if (In_quest(lev)) { |
| 425 | int qlocate_depth = qlocate_level.dlevel; |
| 426 | |
| 427 | /* deepest reached < qlocate implies current < qlocate */ |
| 428 | if (dunlev_reached(lev) < qlocate_depth) |
| 429 | bottom = qlocate_depth; /* early cut-off */ |
| 430 | } else if (In_hell(lev)) { |
| 431 | /* if the invocation hasn't been performed yet, the vibrating square |
| 432 | level is effectively the bottom of Gehennom; the sanctum level is |
| 433 | out of reach until after the invocation */ |
| 434 | if (!u.uevent.invoked) |
| 435 | bottom -= 1; |
| 436 | } |
| 437 | return bottom; |
| 438 | } |
| 439 | |
| 440 | /* destination dlevel for holes or trapdoors */ |
| 441 | staticfn void |
no test coverage detected