From 2d5be0185f1b7582d458243e1fcf23c50fac0570 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 27 Apr 2008 10:19:41 +0000 Subject: (svn r12910) -Fix: Report reverse sprite status (FD/FE) to NewGRF for manually toggled vehicles. --- src/newgrf_engine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3-70-g09d2