| 343 | * listing, then figuring out to which dungeon it belongs. |
| 344 | */ |
| 345 | staticfn xint16 |
| 346 | parent_dnum( |
| 347 | const char *s, /* dungeon name */ |
| 348 | struct proto_dungeon *pd) |
| 349 | { |
| 350 | int i; |
| 351 | xint16 pdnum; |
| 352 | |
| 353 | i = find_branch(s, pd); |
| 354 | /* |
| 355 | * Got branch, now find parent dungeon. Stop if we have reached |
| 356 | * "this" dungeon (if we haven't found it by now it is an error). |
| 357 | */ |
| 358 | for (pdnum = 0; strcmp(pd->tmpdungeon[pdnum].name, s); pdnum++) |
| 359 | if ((i -= pd->tmpdungeon[pdnum].branches) < 0) |
| 360 | return pdnum; |
| 361 | |
| 362 | panic("parent_dnum: couldn't resolve branch."); |
| 363 | /*NOT REACHED*/ |
| 364 | return (xint16) 0; |
| 365 | } |
| 366 | |
| 367 | RESTORE_WARNING_UNREACHABLE_CODE |
| 368 |
no test coverage detected