mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 03:56:43 +00:00
(svn r16272) [0.7] -Backport from trunk:
- Fix: [NoAI] Check slopes passed to the API better for validity (r16264, r16262) - Fix: [NewGRF] Interpret setting bridge property 08 to 0 as always available (r16263) - Add: [NoAI] AIController::GetVersion, this returns the version of OpenTTD in the same way as for NewGRFs (r16253) - Add: [NoAI] AIAirport::GetPrice, returning the building cost of an airport (r16252) - Fix: [NoAI] Enable parameter checking for AIController::* functions again (r16249)
This commit is contained in:
@@ -73,14 +73,14 @@
|
||||
|
||||
/* static */ bool AITile::IsSteepSlope(Slope slope)
|
||||
{
|
||||
if (slope == SLOPE_INVALID) return false;
|
||||
if ((slope & ~(SLOPE_ELEVATED | SLOPE_STEEP | SLOPE_HALFTILE_MASK)) != 0) return false;
|
||||
|
||||
return ::IsSteepSlope((::Slope)slope);
|
||||
}
|
||||
|
||||
/* static */ bool AITile::IsHalftileSlope(Slope slope)
|
||||
{
|
||||
if (slope == SLOPE_INVALID) return false;
|
||||
if ((slope & ~(SLOPE_ELEVATED | SLOPE_STEEP | SLOPE_HALFTILE_MASK)) != 0) return false;
|
||||
|
||||
return ::IsHalftileSlope((::Slope)slope);
|
||||
}
|
||||
@@ -124,9 +124,7 @@
|
||||
|
||||
/* static */ AITile::Slope AITile::GetComplementSlope(Slope slope)
|
||||
{
|
||||
if (slope == SLOPE_INVALID) return SLOPE_INVALID;
|
||||
if (IsSteepSlope(slope)) return SLOPE_INVALID;
|
||||
if (IsHalftileSlope(slope)) return SLOPE_INVALID;
|
||||
if ((slope & ~SLOPE_ELEVATED) != 0) return SLOPE_INVALID;
|
||||
|
||||
return (Slope)::ComplementSlope((::Slope)slope);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user