| 148 | #define BNODE_VERY_CLOSE_DIST 5.0f |
| 149 | |
| 150 | bool EBNode_VerifyGraph() { |
| 151 | bool f_verified = true; |
| 152 | int i; |
| 153 | int j; |
| 154 | int k; |
| 155 | |
| 156 | if (!BNode_allocated) { |
| 157 | mprintf(0, "EBNode Verify: No BNodes for this level\n"); |
| 158 | return false; |
| 159 | } |
| 160 | |
| 161 | MakeBOA(); |
| 162 | |
| 163 | for (i = Highest_room_index + 1; i <= Highest_room_index + BOA_num_terrain_regions; i++) { |
| 164 | bn_list *nlist; |
| 165 | nlist = BNode_GetBNListPtr(i); |
| 166 | int cur_region = i - Highest_room_index - 1; |
| 167 | |
| 168 | for (j = nlist->num_nodes - 1; j >= 0; j--) { |
| 169 | int cell = GetTerrainRoomFromPos(&nlist->nodes[j].pos); |
| 170 | if (cur_region != TERRAIN_REGION(cell)) { |
| 171 | for (k = 0; k < nlist->nodes[j].num_edges; k++) { |
| 172 | if (BOA_INDEX(nlist->nodes[j].edges[k].end_room) >= 0 && |
| 173 | BOA_INDEX(nlist->nodes[j].edges[k].end_room) <= Highest_room_index) { |
| 174 | int r = nlist->nodes[j].edges[k].end_room; |
| 175 | int p = nlist->nodes[j].edges[k].end_index; |
| 176 | |
| 177 | int x; |
| 178 | for (x = 0; x < Rooms[r].num_portals; x++) { |
| 179 | if (Rooms[r].portals[x].bnode_index == p) { |
| 180 | int cr = Rooms[r].portals[x].croom; |
| 181 | int cp = Rooms[r].portals[x].cportal; |
| 182 | |
| 183 | Rooms[cr].portals[cp].bnode_index = -1; |
| 184 | } |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | EBNode_RemoveNode(i, j); |
| 190 | } |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | for (i = 0; i <= Highest_room_index + BOA_num_terrain_regions; i++) { |
| 195 | bn_list *nlist; |
| 196 | int j; |
| 197 | int k; |
| 198 | |
| 199 | if (i >= 0 && i <= Highest_room_index && !Rooms[i].used) |
| 200 | continue; |
| 201 | |
| 202 | if (i <= Highest_room_index && (Rooms[i].flags & RF_EXTERNAL)) |
| 203 | continue; |
| 204 | |
| 205 | nlist = BNode_GetBNListPtr(i); |
| 206 | |
| 207 | for (j = 0; j < nlist->num_nodes; j++) { |
no test coverage detected