Merge branch 'master' into jgrpp
# Conflicts: # src/script/api/script_company.cpp # src/script/api/script_date.cpp # src/script/api/script_date.hpp # src/script/api/script_gamesettings.cpp # src/script/api/script_order.hpp # src/script/api/script_town.cpp # src/script/api/script_window.cpp
This commit is contained in:
@@ -391,7 +391,7 @@ static bool NormaliseTileOffset(int32 *tile)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptRoad::CanBuildConnectedRoadParts(ScriptTile::Slope slope_, Array<> existing, TileIndex start_, TileIndex end_)
|
||||
/* static */ SQInteger ScriptRoad::CanBuildConnectedRoadParts(ScriptTile::Slope slope_, Array<> existing, TileIndex start_, TileIndex end_)
|
||||
{
|
||||
::Slope slope = (::Slope)slope_;
|
||||
int32 start = start_;
|
||||
@@ -412,7 +412,7 @@ static bool NormaliseTileOffset(int32 *tile)
|
||||
return _settings_game.construction.build_on_slopes ? LookupWithBuildOnSlopes(slope, existing, start, end) : LookupWithoutBuildOnSlopes(slope, existing, start, end);
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptRoad::CanBuildConnectedRoadPartsHere(TileIndex tile, TileIndex start, TileIndex end)
|
||||
/* static */ SQInteger ScriptRoad::CanBuildConnectedRoadPartsHere(TileIndex tile, TileIndex start, TileIndex end)
|
||||
{
|
||||
if (!::IsValidTile(tile) || !::IsValidTile(start) || !::IsValidTile(end)) return -1;
|
||||
if (::DistanceManhattan(tile, start) != 1 || ::DistanceManhattan(tile, end) != 1) return -1;
|
||||
@@ -463,10 +463,10 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptRoad::GetNeighbourRoadCount(TileIndex tile)
|
||||
/* static */ SQInteger ScriptRoad::GetNeighbourRoadCount(TileIndex tile)
|
||||
{
|
||||
if (!::IsValidTile(tile)) return false;
|
||||
if (!IsRoadTypeAvailable(GetCurrentRoadType())) return false;
|
||||
if (!::IsValidTile(tile)) return -1;
|
||||
if (!IsRoadTypeAvailable(GetCurrentRoadType())) return -1;
|
||||
|
||||
::RoadType rt = (::RoadType)GetCurrentRoadType();
|
||||
int32 neighbour = 0;
|
||||
@@ -647,14 +647,14 @@ static bool NeighbourHasReachableRoad(::RoadType rt, TileIndex start_tile, DiagD
|
||||
return (RoadTramTypes)(1 << ::GetRoadTramType((::RoadType)roadtype));
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptRoad::GetMaxSpeed(RoadType road_type)
|
||||
/* static */ SQInteger ScriptRoad::GetMaxSpeed(RoadType road_type)
|
||||
{
|
||||
if (!ScriptRoad::IsRoadTypeAvailable(road_type)) return 0;
|
||||
if (!ScriptRoad::IsRoadTypeAvailable(road_type)) return -1;
|
||||
|
||||
return GetRoadTypeInfo((::RoadType)road_type)->max_speed;
|
||||
}
|
||||
|
||||
/* static */ uint16 ScriptRoad::GetMaintenanceCostFactor(RoadType roadtype)
|
||||
/* static */ SQInteger ScriptRoad::GetMaintenanceCostFactor(RoadType roadtype)
|
||||
{
|
||||
if (!ScriptRoad::IsRoadTypeAvailable(roadtype)) return 0;
|
||||
|
||||
|
Reference in New Issue
Block a user