comparison src/train_cmd.cpp @ 13488:aba01968c037 draft

(svn r18007) -Codechange: No need to call CB 36 'running cost factor' if the vehicle has no running cost class anyway.
author frosch <frosch@openttd.org>
date Sun, 08 Nov 2009 12:18:59 +0000
parents ddfb6a69b9c3
children eb34fcf7db5f
comparison
equal deleted inserted replaced
13487:4ff75a36a676 13488:aba01968c037
4434 Money cost = 0; 4434 Money cost = 0;
4435 const Train *v = this; 4435 const Train *v = this;
4436 4436
4437 do { 4437 do {
4438 const RailVehicleInfo *rvi = RailVehInfo(v->engine_type); 4438 const RailVehicleInfo *rvi = RailVehInfo(v->engine_type);
4439 if (rvi->running_cost_class == INVALID_PRICE) continue;
4439 4440
4440 byte cost_factor = GetVehicleProperty(v, PROP_TRAIN_RUNNING_COST_FACTOR, rvi->running_cost); 4441 byte cost_factor = GetVehicleProperty(v, PROP_TRAIN_RUNNING_COST_FACTOR, rvi->running_cost);
4441 if (cost_factor == 0) continue; 4442 if (cost_factor == 0) continue;
4442 4443
4443 /* Halve running cost for multiheaded parts */ 4444 /* Halve running cost for multiheaded parts */