summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-12-29 12:42:59 +0000
committertron <tron@openttd.org>2005-12-29 12:42:59 +0000
commited4b89ee3624784d7ca0896ebc698be814744c60 (patch)
tree471052da802f2cc20f631ca0291f7337c78cd45d /train_cmd.c
parent901068fd6e2b2c7059a59b5ec97c92e1ffe0633c (diff)
downloadopenttd-ed4b89ee3624784d7ca0896ebc698be814744c60.tar.xz
(svn r3353) Simplify the automatic length adjustment algorithm for replacing trains: Use the length of the train before the replacement as reference length
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/train_cmd.c b/train_cmd.c
index f75dff5d7..dd7f19735 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -755,9 +755,6 @@ int32 CmdBuildRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
SetFrontEngine(v);
SetTrainEngine(v);
- v->u.rail.shortest_platform[0] = 255;
- v->u.rail.shortest_platform[1] = 0;
-
VehiclePositionChanged(v);
if (rvi->flags & RVI_MULTIHEAD) {
@@ -2427,27 +2424,6 @@ static bool ProcessTrainOrder(Vehicle *v)
v->dest_tile = 0;
- // store the station length if no shorter station was visited this order round
- if (v->cur_order_index == 0) {
- if (v->u.rail.shortest_platform[1] != 0 && v->u.rail.shortest_platform[1] != 255) {
- // we went though a whole round of orders without interruptions, so we store the length of the shortest station
- v->u.rail.shortest_platform[0] = v->u.rail.shortest_platform[1];
- }
- // all platforms are shorter than 255, so now we can find the shortest in the next order round. They might have changed size
- v->u.rail.shortest_platform[1] = 255;
- }
-
- if (v->last_station_visited != INVALID_STATION) {
- Station *st = GetStation(v->last_station_visited);
- if (TileBelongsToRailStation(st, v->tile)) {
- byte length = GetStationPlatforms(st, v->tile);
-
- if (length < v->u.rail.shortest_platform[1]) {
- v->u.rail.shortest_platform[1] = length;
- }
- }
- }
-
result = false;
switch (order->type) {
case OT_GOTO_STATION: