MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / FootpathDisconnectQueueFromPath

Function FootpathDisconnectQueueFromPath

src/openrct2/world/Footpath.cpp:445–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 *

Callers 2

Loc6A6F1FFunction · 0.85

Calls 6

IsQueueMethod · 0.45
asPathMethod · 0.45
IsSlopedMethod · 0.45
GetEdgesMethod · 0.45
GetSlopeDirectionMethod · 0.45

Tested by

no test coverage detected