MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / IsSlopeRefused

Function IsSlopeRefused

src/industry_cmd.cpp:1448–1463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1446}
1447
1448bool IsSlopeRefused(Slope current, Slope refused)
1449{
1450 if (IsSteepSlope(current)) return true;
1451 if (current != SLOPE_FLAT) {
1452 if (IsSteepSlope(refused)) return true;
1453
1454 Slope t = ComplementSlope(current);
1455
1456 if ((refused & SLOPE_W) && (t & SLOPE_NW)) return true;
1457 if ((refused & SLOPE_S) && (t & SLOPE_NE)) return true;
1458 if ((refused & SLOPE_E) && (t & SLOPE_SW)) return true;
1459 if ((refused & SLOPE_N) && (t & SLOPE_SE)) return true;
1460 }
1461
1462 return false;
1463}
1464
1465/**
1466 * Are the tiles of the industry free?

Callers 2

Calls 2

IsSteepSlopeFunction · 0.85
ComplementSlopeFunction · 0.85

Tested by

no test coverage detected