diff options
author | frosch <frosch@openttd.org> | 2012-09-16 16:29:48 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-09-16 16:29:48 +0000 |
commit | e37e2d92a62b4a66d6af0bc4da233a9f442a90c6 (patch) | |
tree | deae5c12dff888163dc47e01b001455502c9204e | |
parent | ce9019639dc9c3a046696f78b9f54d31f540cecb (diff) | |
download | openttd-e37e2d92a62b4a66d6af0bc4da233a9f442a90c6.tar.xz |
(svn r24527) -Add: [NewGRF] Allow resolving var 5F via vehicle var 61.
-rw-r--r-- | src/newgrf_engine.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 23f32924f..219f2ae92 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -645,7 +645,12 @@ static uint32 VehicleGetVariable(Vehicle *v, const ResolverObject *object, byte Vehicle *u = v->Move((int32)GetRegister(0x10F)); if (u == NULL) return 0; - return VehicleGetVariable(u, object, parameter, GetRegister(0x10E), available); + if (parameter == 0x5F) { + /* This seems to be the only variable that makes sense to access via var 61, but is not handled by VehicleGetVariable */ + return (u->random_bits << 8) | u->waiting_triggers; + } else { + return VehicleGetVariable(u, object, parameter, GetRegister(0x10E), available); + } } return 0; |