From e781929d7f7d472bd400cc0d00407c97f469f841 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 8 Nov 2009 12:18:59 +0000 Subject: [PATCH] (svn r18007) -Codechange: No need to call CB 36 'running cost factor' if the vehicle has no running cost class anyway. --- src/train_cmd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 1dd977353f..0be119ef97 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -4436,6 +4436,7 @@ Money Train::GetRunningCost() const do { const RailVehicleInfo *rvi = RailVehInfo(v->engine_type); + if (rvi->running_cost_class == INVALID_PRICE) continue; byte cost_factor = GetVehicleProperty(v, PROP_TRAIN_RUNNING_COST_FACTOR, rvi->running_cost); if (cost_factor == 0) continue;