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
commit2d5be0185f1b7582d458243e1fcf23c50fac0570 (patch)
tree2f4ebc0559fbf0b994673e945efa37f2ef739217 /src
parentbf3542e9f70ee012ea574b5242f7d54e070a69af (diff)
downloadopenttd-2d5be0185f1b7582d458243e1fcf23c50fac0570.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;