summaryrefslogtreecommitdiff
path: root/src/roadveh.h
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-10-30 14:31:49 +0000
committerterkhen <terkhen@openttd.org>2010-10-30 14:31:49 +0000
commitc87e023d7a4e594eac97e371cbe6ce515402bec1 (patch)
treee95e729d682f8f6f0a3c444910b5cb6a16dc06d8 /src/roadveh.h
parent0baf335be3af23144a61a7230686b8811dc953ba (diff)
downloadopenttd-c87e023d7a4e594eac97e371cbe6ce515402bec1.tar.xz
(svn r21058) -Feature [NewGRF]: Add CB36 support for road vehicle properties 0x13 (Power), 0x14 (Weight) and 0x18 (Tractive effort).
Diffstat (limited to 'src/roadveh.h')
-rw-r--r--src/roadveh.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/roadveh.h b/src/roadveh.h
index 85db80ccf..8a424dd34 100644
--- a/src/roadveh.h
+++ b/src/roadveh.h
@@ -17,6 +17,8 @@
#include "cargotype.h"
#include "track_func.h"
#include "road_type.h"
+#include "newgrf_properties.h"
+#include "newgrf_engine.h"
struct RoadVehicle;
@@ -171,7 +173,8 @@ protected: // These functions should not be called outside acceleration code.
{
/* Power is not added for articulated parts */
if (!this->IsArticulatedPart()) {
- return 10 * RoadVehInfo(this->engine_type)->power; // Road vehicle power is in units of 10 HP.
+ /* Road vehicle power is in units of 10 HP. */
+ return 10 * GetVehicleProperty(this, PROP_ROADVEH_POWER, RoadVehInfo(this->engine_type)->power);
}
return 0;
}
@@ -195,7 +198,8 @@ protected: // These functions should not be called outside acceleration code.
/* Vehicle weight is not added for articulated parts. */
if (!this->IsArticulatedPart()) {
- weight += RoadVehInfo(this->engine_type)->weight / 4; // Road vehicle weight is in units of 1/4 t.
+ /* Road vehicle weight is in units of 1/4 t. */
+ weight += GetVehicleProperty(this, PROP_ROADVEH_WEIGHT, RoadVehInfo(this->engine_type)->weight) / 4;
}
return weight;
@@ -207,7 +211,8 @@ protected: // These functions should not be called outside acceleration code.
*/
FORCEINLINE byte GetTractiveEffort() const
{
- return RoadVehInfo(this->engine_type)->tractive_effort;
+ /* The tractive effort coefficient is in units of 1/256. */
+ return GetVehicleProperty(this, PROP_ROADVEH_TRACTIVE_EFFORT, RoadVehInfo(this->engine_type)->tractive_effort);
}
/**