| 1414 | } |
| 1415 | |
| 1416 | void GateGraph::fillPathMap(int x, int y) |
| 1417 | { |
| 1418 | int* parentMap = nullptr; |
| 1419 | if ( parentMapType == GateGraph::GATE_GRAPH_GROUNDED ) |
| 1420 | { |
| 1421 | parentMap = pathMapGrounded; |
| 1422 | } |
| 1423 | else if ( parentMapType == GateGraph::GATE_GRAPH_FLYING ) |
| 1424 | { |
| 1425 | parentMap = pathMapFlying; |
| 1426 | } |
| 1427 | |
| 1428 | node_t* node; |
| 1429 | list_t* list = checkTileForEntity(x, y); |
| 1430 | if ( list ) |
| 1431 | { |
| 1432 | for ( node = list->first; node != NULL; node = node->next ) |
| 1433 | { |
| 1434 | Entity* entity = (Entity*)node->element; |
| 1435 | if ( entity ) |
| 1436 | { |
| 1437 | if ( entity->behavior == &actGate ) |
| 1438 | { |
| 1439 | return; |
| 1440 | } |
| 1441 | } |
| 1442 | } |
| 1443 | } |
| 1444 | |
| 1445 | mapSubzones[y + x * map.height] = numSubzones; |
| 1446 | |
| 1447 | bool repeat; |
| 1448 | do |
| 1449 | { |
| 1450 | repeat = false; |
| 1451 | |
| 1452 | int u, v; |
| 1453 | for ( u = 0; u < map.width; u++ ) |
| 1454 | { |
| 1455 | for ( v = 0; v < map.height; v++ ) |
| 1456 | { |
| 1457 | if ( mapSubzones[v + u * map.height] == numSubzones ) |
| 1458 | { |
| 1459 | if ( u < map.width - 1 ) |
| 1460 | { |
| 1461 | if ( !mapSubzones[v + (u + 1)*map.height] ) |
| 1462 | { |
| 1463 | bool foundObstacle = false; |
| 1464 | list_t* list = checkTileForEntity(u + 1, v); |
| 1465 | if ( list ) |
| 1466 | { |
| 1467 | node_t* node; |
| 1468 | for ( node = list->first; node != NULL; node = node->next ) |
| 1469 | { |
| 1470 | Entity* entity = (Entity*)node->element; |
| 1471 | if ( entity ) |
| 1472 | { |
| 1473 | if ( entity->behavior == &actGate ) |
nothing calls this directly
no test coverage detected