| 1396 | } |
| 1397 | |
| 1398 | DISABLE_WARNING_UNREACHABLE_CODE |
| 1399 | |
| 1400 | /* return the dungeon that this ledgerno exists in */ |
| 1401 | xint16 |
| 1402 | ledger_to_dnum(xint16 ledgerno) |
| 1403 | { |
| 1404 | xint16 i; |
| 1405 | |
| 1406 | /* find i such that (i->base + 1) <= ledgerno <= (i->base + i->count) */ |
| 1407 | for (i = 0; i < svn.n_dgns; i++) |
| 1408 | if (svd.dungeons[i].ledger_start < ledgerno |
| 1409 | && ledgerno <= (svd.dungeons[i].ledger_start |
| 1410 | + svd.dungeons[i].num_dunlevs)) |
| 1411 | return i; |
| 1412 | |
| 1413 | panic("level number out of range [ledger_to_dnum(%d)]", (int) ledgerno); |
| 1414 | /*NOT REACHED*/ |
| 1415 | return (xint16) 0; |
| 1416 | } |
| 1417 | |
| 1418 | RESTORE_WARNING_UNREACHABLE_CODE |
| 1419 |
no test coverage detected