summaryrefslogtreecommitdiff
path: root/src/newgrf_engine.cpp
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-02-28 17:59:05 +0000
committermaedhros <maedhros@openttd.org>2007-02-28 17:59:05 +0000
commit469fbc912c2f8b502f683362a86f86d0aa991751 (patch)
tree69eb785ea7e1b67aa0b9366a3f703c525d13e4df /src/newgrf_engine.cpp
parentaadd8a4b44e0f67e5a2ccb685a56fc258c1eb9ff (diff)
downloadopenttd-469fbc912c2f8b502f683362a86f86d0aa991751.tar.xz
(svn r8946) -Feature: [NewGRF] Add support for vehicle variables 0xFE and 0xFF bit 10,
which is set when a vehicle was built during the exclusive testing phase.
Diffstat (limited to 'src/newgrf_engine.cpp')
-rw-r--r--src/newgrf_engine.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index dd38fbafc..e9e5dd86c 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -601,6 +601,21 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
}
case 0x7F: return GetGRFParameter(v->engine_type, parameter); /* Read GRF parameter */
+
+ case 0xFE:
+ case 0xFF: {
+ uint16 modflags = 0;
+
+ /* TODO: There are some other bits that should be implemented:
+ * bit 5: Whether the rail vehicle is powered or not (mostly useful for wagons).
+ * bit 6: This is an electrically powered rail vehicle which is running on normal rail.
+ * bit 8: (Maybe?) Toggled whenever the train reverses.
+ */
+
+ if (HASBIT(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE)) SETBIT(modflags, 10);
+
+ return variable == 0xFE ? modflags : GB(modflags, 8, 8);
+ }
}
/* General vehicle properties */