summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/train_cmd.c b/train_cmd.c
index bd9b9bd86..3a1594c22 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -3560,7 +3560,7 @@ int32 GetTrainRunningCost(const Vehicle *v)
const RailVehicleInfo *rvi = RailVehInfo(v->engine_type);
if (rvi->running_cost_base > 0)
cost += rvi->running_cost_base * _price.running_rail[rvi->running_cost_class];
- } while ((v = v->next) != NULL);
+ } while ((v = GetNextVehicle(v)) != NULL);
return cost;
}