(svn r21058) -Feature [NewGRF]: Add CB36 support for road vehicle properties 0x13 (Power), 0x14 (Weight) and 0x18 (Tractive effort).

This commit is contained in:
terkhen
2010-10-30 14:31:49 +00:00
parent 0baf335be3
commit c87e023d7a
4 changed files with 17 additions and 9 deletions

View File

@@ -319,7 +319,7 @@ uint Engine::GetPower() const
case VEH_TRAIN:
return GetEngineProperty(this->index, PROP_TRAIN_POWER, this->u.rail.power);
case VEH_ROAD:
return this->u.road.power * 10;
return GetEngineProperty(this->index, PROP_ROADVEH_POWER, this->u.road.power) * 10;
default: NOT_REACHED();
}
@@ -337,7 +337,7 @@ uint Engine::GetDisplayWeight() const
case VEH_TRAIN:
return GetEngineProperty(this->index, PROP_TRAIN_WEIGHT, this->u.rail.weight) << (this->u.rail.railveh_type == RAILVEH_MULTIHEAD ? 1 : 0);
case VEH_ROAD:
return this->u.road.weight / 4;
return GetEngineProperty(this->index, PROP_ROADVEH_WEIGHT, this->u.road.weight) / 4;
default: NOT_REACHED();
}
@@ -355,7 +355,7 @@ uint Engine::GetDisplayMaxTractiveEffort() const
case VEH_TRAIN:
return (10 * this->GetDisplayWeight() * GetEngineProperty(this->index, PROP_TRAIN_TRACTIVE_EFFORT, this->u.rail.tractive_effort)) / 256;
case VEH_ROAD:
return (10 * this->GetDisplayWeight() * this->u.road.tractive_effort) / 256;
return (10 * this->GetDisplayWeight() * GetEngineProperty(this->index, PROP_ROADVEH_TRACTIVE_EFFORT, this->u.road.tractive_effort)) / 256;
default: NOT_REACHED();
}