Codechange: Use SQInteger for generic numbers in script_rail
This commit is contained in:
@@ -147,7 +147,7 @@
|
||||
return ScriptObject::Command<CMD_BUILD_TRAIN_DEPOT>::Do(tile, (::RailType)ScriptObject::GetRailType(), entrance_dir);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptRail::BuildRailStation(TileIndex tile, RailTrack direction, uint num_platforms, uint platform_length, StationID station_id)
|
||||
/* static */ bool ScriptRail::BuildRailStation(TileIndex tile, RailTrack direction, SQInteger num_platforms, SQInteger platform_length, StationID station_id)
|
||||
{
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
|
||||
EnforcePrecondition(false, ::IsValidTile(tile));
|
||||
@@ -161,7 +161,7 @@
|
||||
return ScriptObject::Command<CMD_BUILD_RAIL_STATION>::Do(tile, (::RailType)GetCurrentRailType(), direction == RAILTRACK_NW_SE ? AXIS_Y : AXIS_X, num_platforms, platform_length, STAT_CLASS_DFLT, 0, ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION, adjacent);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptRail::BuildNewGRFRailStation(TileIndex tile, RailTrack direction, uint num_platforms, uint platform_length, StationID station_id, CargoID cargo_id, IndustryType source_industry, IndustryType goal_industry, int distance, bool source_station)
|
||||
/* static */ bool ScriptRail::BuildNewGRFRailStation(TileIndex tile, RailTrack direction, SQInteger num_platforms, SQInteger platform_length, StationID station_id, CargoID cargo_id, IndustryType source_industry, IndustryType goal_industry, SQInteger distance, bool source_station)
|
||||
{
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
|
||||
EnforcePrecondition(false, ::IsValidTile(tile));
|
||||
@@ -181,10 +181,10 @@
|
||||
0,
|
||||
source_industry,
|
||||
goal_industry,
|
||||
std::min(255, distance / 2),
|
||||
std::min<SQInteger>(255, distance / 2),
|
||||
AICE_STATION_GET_STATION_ID,
|
||||
source_station ? 0 : 1,
|
||||
std::min(15u, num_platforms) << 4 | std::min(15u, platform_length),
|
||||
std::min<SQInteger>(15u, num_platforms) << 4 | std::min<SQInteger>(15u, platform_length),
|
||||
&file
|
||||
);
|
||||
|
||||
@@ -504,14 +504,14 @@ static bool IsValidSignalType(int signal_type)
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptRail::GetMaxSpeed(RailType railtype)
|
||||
/* static */ SQInteger ScriptRail::GetMaxSpeed(RailType railtype)
|
||||
{
|
||||
if (!ScriptRail::IsRailTypeAvailable(railtype)) return -1;
|
||||
|
||||
return ::GetRailTypeInfo((::RailType)railtype)->max_speed;
|
||||
}
|
||||
|
||||
/* static */ uint16 ScriptRail::GetMaintenanceCostFactor(RailType railtype)
|
||||
/* static */ SQInteger ScriptRail::GetMaintenanceCostFactor(RailType railtype)
|
||||
{
|
||||
if (!ScriptRail::IsRailTypeAvailable(railtype)) return 0;
|
||||
|
||||
|
Reference in New Issue
Block a user