summaryrefslogtreecommitdiff
path: root/src/script/api
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2018-07-23 00:05:23 +0100
committerPeterN <peter@fuzzle.org>2018-07-26 13:27:40 +0100
commitbf8d7df7367055dcfad6cc1c21fd9c762ffc2fe4 (patch)
tree8fe03509c7d1ef6ef092521632e2cc32a36e3287 /src/script/api
parent5db883fbe9b8ef6171bfafc145a80932c3920504 (diff)
downloadopenttd-bf8d7df7367055dcfad6cc1c21fd9c762ffc2fe4.tar.xz
Change: Extend rail types to 64 (6 bit storage)
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/script_rail.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/script/api/script_rail.cpp b/src/script/api/script_rail.cpp
index af68a3edc..25ad2ec13 100644
--- a/src/script/api/script_rail.cpp
+++ b/src/script/api/script_rail.cpp
@@ -157,7 +157,7 @@
EnforcePrecondition(false, station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id));
uint32 p1 = GetCurrentRailType() | (platform_length << 16) | (num_platforms << 8);
- if (direction == RAILTRACK_NW_SE) p1 |= (1 << 4);
+ if (direction == RAILTRACK_NW_SE) p1 |= (1 << 6);
if (station_id != ScriptStation::STATION_JOIN_ADJACENT) p1 |= (1 << 24);
return ScriptObject::DoCommand(tile, p1, (ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION) << 16, CMD_BUILD_RAIL_STATION);
}
@@ -176,7 +176,7 @@
EnforcePrecondition(false, goal_industry == ScriptIndustryType::INDUSTRYTYPE_UNKNOWN || goal_industry == ScriptIndustryType::INDUSTRYTYPE_TOWN || ScriptIndustryType::IsValidIndustryType(goal_industry));
uint32 p1 = GetCurrentRailType() | (platform_length << 16) | (num_platforms << 8);
- if (direction == RAILTRACK_NW_SE) p1 |= 1 << 4;
+ if (direction == RAILTRACK_NW_SE) p1 |= 1 << 6;
if (station_id != ScriptStation::STATION_JOIN_ADJACENT) p1 |= (1 << 24);
const GRFFile *file;
@@ -244,7 +244,7 @@
EnforcePrecondition(false, KillFirstBit((uint)rail_track) == 0);
EnforcePrecondition(false, IsRailTypeAvailable(GetCurrentRailType()));
- return ScriptObject::DoCommand(tile, tile, GetCurrentRailType() | (FindFirstTrack((::TrackBits)rail_track) << 4), CMD_BUILD_RAILROAD_TRACK);
+ return ScriptObject::DoCommand(tile, tile, GetCurrentRailType() | (FindFirstTrack((::TrackBits)rail_track) << 6), CMD_BUILD_RAILROAD_TRACK);
}
/* static */ bool ScriptRail::RemoveRailTrack(TileIndex tile, RailTrack rail_track)
@@ -255,7 +255,7 @@
EnforcePrecondition(false, GetRailTracks(tile) & rail_track);
EnforcePrecondition(false, KillFirstBit((uint)rail_track) == 0);
- return ScriptObject::DoCommand(tile, tile, FindFirstTrack((::TrackBits)rail_track) << 4, CMD_REMOVE_RAILROAD_TRACK);
+ return ScriptObject::DoCommand(tile, tile, FindFirstTrack((::TrackBits)rail_track) << 6, CMD_REMOVE_RAILROAD_TRACK);
}
/* static */ bool ScriptRail::AreTilesConnected(TileIndex from, TileIndex tile, TileIndex to)
@@ -355,7 +355,7 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to)
(::TileX(from) == ::TileX(tile) && ::TileX(tile) == ::TileX(to)) ||
(::TileY(from) == ::TileY(tile) && ::TileY(tile) == ::TileY(to)));
- uint32 p2 = SimulateDrag(from, tile, &to) | 1 << 8 | ScriptRail::GetCurrentRailType();;
+ uint32 p2 = SimulateDrag(from, tile, &to) | 1 << 10 | ScriptRail::GetCurrentRailType();;
return ScriptObject::DoCommand(tile, to, p2, CMD_BUILD_RAILROAD_TRACK);
}