| 443 | } |
| 444 | |
| 445 | static bool FootpathDisconnectQueueFromPath(const CoordsXY& footpathPos, TileElement* tileElement, int32_t action) |
| 446 | { |
| 447 | if (!tileElement->asPath()->IsQueue()) |
| 448 | return false; |
| 449 | |
| 450 | if (tileElement->asPath()->IsSloped()) |
| 451 | return false; |
| 452 | |
| 453 | uint8_t c = connected_path_count[tileElement->asPath()->GetEdges()]; |
| 454 | if ((action < 0) ? (c >= 2) : (c < 2)) |
| 455 | return false; |
| 456 | |
| 457 | if (action < 0) |
| 458 | { |
| 459 | uint8_t direction = tileElement->asPath()->GetSlopeDirection(); |
| 460 | if (FootpathReconnectQueueToPath(footpathPos, tileElement, action, direction)) |
| 461 | return true; |
| 462 | } |
| 463 | |
| 464 | for (Direction direction : kAllDirections) |
| 465 | { |
| 466 | if ((action < 0) && (direction == tileElement->asPath()->GetSlopeDirection())) |
| 467 | continue; |
| 468 | if (FootpathReconnectQueueToPath(footpathPos, tileElement, action, direction)) |
| 469 | return true; |
| 470 | } |
| 471 | |
| 472 | return false; |
| 473 | } |
| 474 | |
| 475 | /** |
| 476 | * |
no test coverage detected