| 981 | } |
| 982 | |
| 983 | int32_t FootpathQueueCountConnections(const CoordsXY& position, const PathElement& pathElement) |
| 984 | { |
| 985 | int32_t connectionCount = 0; |
| 986 | for (const Direction direction : kAllDirections) |
| 987 | { |
| 988 | const uint8_t edge = 1 << direction; |
| 989 | if (pathElement.GetEdges() & edge) |
| 990 | { |
| 991 | const CoordsXY adjacentPathPosition = position + CoordsDirectionDelta[direction]; |
| 992 | const int32_t z = pathElement.getBaseZ(); |
| 993 | const TileElement* tileElement = FootpathGetElement( |
| 994 | { adjacentPathPosition, z, z + kLandHeightStep }, direction); |
| 995 | |
| 996 | if (tileElement == nullptr) |
| 997 | { |
| 998 | tileElement = FootpathGetElement({ adjacentPathPosition, z - kLandHeightStep, z }, direction); |
| 999 | |
| 1000 | if (tileElement == nullptr) |
| 1001 | { |
| 1002 | const EntranceElement* entrance = MapGetRideEntranceElementAt( |
| 1003 | CoordsXYZ{ adjacentPathPosition, z }, true); |
| 1004 | if (entrance == nullptr) |
| 1005 | { |
| 1006 | entrance = MapGetRideEntranceElementAt( |
| 1007 | CoordsXYZ{ adjacentPathPosition, z + kLandHeightStep }, true); |
| 1008 | if (entrance == nullptr) |
| 1009 | continue; |
| 1010 | } |
| 1011 | |
| 1012 | if (entrance_has_direction(*entrance, direction + entrance->getDirection())) |
| 1013 | { |
| 1014 | connectionCount++; |
| 1015 | } |
| 1016 | continue; |
| 1017 | } |
| 1018 | } |
| 1019 | |
| 1020 | const PathElement& adjacentPath = *tileElement->asPath(); |
| 1021 | |
| 1022 | if (adjacentPath.GetEdges() & Numerics::rol4(edge, 2)) |
| 1023 | { |
| 1024 | connectionCount++; |
| 1025 | } |
| 1026 | } |
| 1027 | } |
| 1028 | return connectionCount; |
| 1029 | } |
| 1030 | |
| 1031 | /** |
| 1032 | * |
no test coverage detected