* * Returns: * PathSearchResult::Wide - path with wide flag set * PathSearchResult::RideQueue - queue path connected to a ride * PathSearchResult::Other - other path than the above * PathSearchResult::Failed - no path element found * * rct2: 0x00694BAE * * Returns the type of the next footpath tile a peep can get to from x,y,z / * inputTil
| 342 | * inputTileElement in the given direction. |
| 343 | */ |
| 344 | static PathSearchResult FootpathElementNextInDirection( |
| 345 | TileCoordsXYZ loc, PathElement* pathElement, Direction chosenDirection) |
| 346 | { |
| 347 | if (pathElement->IsSloped()) |
| 348 | { |
| 349 | if (pathElement->GetSlopeDirection() == chosenDirection) |
| 350 | { |
| 351 | loc.z += 2; |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | loc += TileDirectionDelta[chosenDirection]; |
| 356 | TileElement* nextTileElement = MapGetFirstElementAt(loc); |
| 357 | do |
| 358 | { |
| 359 | if (nextTileElement == nullptr) |
| 360 | break; |
| 361 | if (nextTileElement->isGhost()) |
| 362 | continue; |
| 363 | if (nextTileElement->getType() != TileElementType::Path) |
| 364 | continue; |
| 365 | const auto* nextPathElement = nextTileElement->asPath(); |
| 366 | if (!FootpathIsZAndDirectionValid(*nextPathElement, loc.z, chosenDirection)) |
| 367 | continue; |
| 368 | if (nextPathElement->IsWide()) |
| 369 | return PathSearchResult::Wide; |
| 370 | // Only queue tiles that are connected to a ride are returned as ride queues. |
| 371 | if (nextPathElement->IsQueue() && !nextPathElement->GetRideIndex().IsNull()) |
| 372 | return PathSearchResult::RideQueue; |
| 373 | |
| 374 | return PathSearchResult::Other; |
| 375 | } while (!(nextTileElement++)->isLastForTile()); |
| 376 | |
| 377 | return PathSearchResult::Failed; |
| 378 | } |
| 379 | |
| 380 | /** |
| 381 | * |
no test coverage detected