MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / compute_mine_info

Function compute_mine_info

Descent3/BOA.cpp:606–645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

604}
605
606void compute_mine_info() {
607 int i;
608 char checked[MAX_ROOMS];
609 bool done = false;
610 int first_free;
611 int cur_mine = 0;
612
613 for (i = 0; i <= Highest_room_index; i++) {
614 room *rp = &Rooms[i];
615
616 if (rp->used) {
617 rp->flags &= ~RFM_MINE;
618 }
619
620 checked[i] = 0;
621 }
622
623 while (!done) {
624 ASSERT(cur_mine < 32);
625
626 done = true;
627
628 for (i = 0; i <= Highest_room_index; i++) {
629 room *rp = &Rooms[i];
630
631 if (rp->used && !checked[i]) {
632 first_free = i;
633 done = false;
634 break;
635 }
636 }
637
638 if (!done) {
639 add_mine_room(first_free, cur_mine, checked);
640 cur_mine++;
641 }
642 }
643
644 BOA_num_mines = cur_mine;
645}
646
647void add_terrain_cell(int cell, int t_region, char *checked) {
648 int depth = 0;

Callers 1

MakeBOAFunction · 0.85

Calls 1

add_mine_roomFunction · 0.85

Tested by

no test coverage detected