| 1289 | } |
| 1290 | |
| 1291 | void EBNode_ComputeEdgeCosts(int sroom, int spnt, int eroom, int epnt) { |
| 1292 | int i, j; |
| 1293 | bool f_found = false; |
| 1294 | |
| 1295 | bn_list *snlist; |
| 1296 | snlist = BNode_GetBNListPtr(sroom); |
| 1297 | bn_list *enlist; |
| 1298 | enlist = BNode_GetBNListPtr(eroom); |
| 1299 | |
| 1300 | for (i = 0; i < snlist->nodes[spnt].num_edges; i++) { |
| 1301 | for (j = 0; j < enlist->nodes[epnt].num_edges; j++) { |
| 1302 | if ((snlist->nodes[spnt].edges[i].end_index == epnt && snlist->nodes[spnt].edges[i].end_room == eroom) && |
| 1303 | (enlist->nodes[epnt].edges[j].end_index == spnt && enlist->nodes[epnt].edges[j].end_room == sroom)) { |
| 1304 | f_found = true; |
| 1305 | |
| 1306 | float cost = vm_VectorDistance(&snlist->nodes[spnt].pos, &enlist->nodes[epnt].pos); |
| 1307 | if (cost < 1.0f) |
| 1308 | cost = 1.0f; |
| 1309 | |
| 1310 | int16_t scost = (cost < 32767.0f) ? (int16_t)cost : (int16_t)32767; |
| 1311 | |
| 1312 | snlist->nodes[spnt].edges[i].cost = scost; |
| 1313 | enlist->nodes[epnt].edges[j].cost = scost; |
| 1314 | |
| 1315 | snlist->nodes[spnt].edges[i].max_rad = enlist->nodes[epnt].edges[j].max_rad = |
| 1316 | EBNode_DetermineMaxSizeForEdge(spnt, sroom, epnt, eroom); |
| 1317 | } |
| 1318 | } |
| 1319 | } |
| 1320 | |
| 1321 | ASSERT(f_found == true); // If you get this -- Get Chris!!!!!!! |
| 1322 | } |
| 1323 | |
| 1324 | void EBNode_Move(bool f_offset, int roomnum, int pnt, vector *pos) { |
| 1325 | bn_list *nlist; |
no test coverage detected