| 595 | } |
| 596 | |
| 597 | staticfn int |
| 598 | possible_places( |
| 599 | int idx, /* prototype index */ |
| 600 | boolean *map, /* array MAXLEVEL+1 in length */ |
| 601 | struct proto_dungeon *pd) |
| 602 | { |
| 603 | int i, start, count; |
| 604 | s_level *lev = pd->final_lev[idx]; |
| 605 | |
| 606 | /* init level possibilities */ |
| 607 | for (i = 0; i <= MAXLEVEL; i++) |
| 608 | map[i] = FALSE; |
| 609 | |
| 610 | /* get base and range and set those entries to true */ |
| 611 | count = level_range(lev->dlevel.dnum, pd->tmplevel[idx].lev.base, |
| 612 | pd->tmplevel[idx].lev.rand, pd->tmplevel[idx].chain, |
| 613 | pd, &start); |
| 614 | for (i = start; i < start + count; i++) |
| 615 | map[i] = TRUE; |
| 616 | |
| 617 | /* mark off already placed levels */ |
| 618 | for (i = pd->start; i < idx; i++) { |
| 619 | if (pd->final_lev[i] && map[pd->final_lev[i]->dlevel.dlevel]) { |
| 620 | map[pd->final_lev[i]->dlevel.dlevel] = FALSE; |
| 621 | --count; |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | return count; |
| 626 | } |
| 627 | |
| 628 | DISABLE_WARNING_UNREACHABLE_CODE |
| 629 |
no test coverage detected