summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-04-27 10:19:41 +0000
committerpeter1138 <peter1138@openttd.org>2008-04-27 10:19:41 +0000
commit3f2513b5ace7914d6ebd9728665240036bd2e64d (patch)
tree2f4ebc0559fbf0b994673e945efa37f2ef739217 /src
parent9e1b8b69e32e3ea7fd3ec60f7cbb07f034a4beb3 (diff)
downloadopenttd-3f2513b5ace7914d6ebd9728665240036bd2e64d.tar.xz
(svn r12910) -Fix: Report reverse sprite status (FD/FE) to NewGRF for manually toggled vehicles.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_engine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index d98cfcbc0..b7a83663e 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -724,7 +724,10 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
case 0x45: return v->unitnumber;
case 0x46: return v->engine_type;
case 0x47: return GB(v->engine_type, 8, 8);
- case 0x48: return v->spritenum;
+ case 0x48:
+ if (v->type != VEH_TRAIN || v->spritenum != 0xFD) return v->spritenum;
+ return HasBit(v->u.rail.flags, VRF_REVERSE_DIRECTION) ? 0xFE : 0xFD;
+
case 0x49: return v->day_counter;
case 0x4A: return v->breakdowns_since_last_service;
case 0x4B: return v->breakdown_ctr;