From 6a58f3487860dafde6f9b3653e75b78f74108f02 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 13 Feb 2011 19:49:53 +0000 Subject: (svn r22072) -Fix (r21966): flipping wasn't (correctly) disabled in some cases --- src/newgrf.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/newgrf.cpp b/src/newgrf.cpp index e6843fb24..267d47656 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -189,6 +189,7 @@ struct GRFTempEngineData { uint16 cargo_disallowed; RailTypeLabel railtypelabel; bool refitmask_valid; ///< Did the newgrf set any refittability property? If not, default refittability will be applied. + bool prop27_set; ///< Did the NewGRF set property 27 (misc flags)? uint8 rv_max_speed; ///< Temporary storage of RV prop 15, maximum speed in mph/0.8 }; @@ -753,6 +754,7 @@ static ChangeInfoResult RailVehicleChangeInfo(uint engine, int numinfo, int prop case 0x27: // Miscellaneous flags ei->misc_flags = buf->ReadByte(); _loaded_newgrf_features.has_2CC |= HasBit(ei->misc_flags, EF_USES_2CC); + _gted[e->index].prop27_set = true; break; case 0x28: // Cargo classes allowed @@ -7478,6 +7480,13 @@ static void FinaliseEngineArray() } } + /* When the train does not set property 27 (misc flags), but it + * is overridden by a NewGRF graphically we want to disable the + * flipping possibility. */ + if (e->type == VEH_TRAIN && !_gted[e->index].prop27_set && e->grf_prop.grffile != NULL && is_custom_sprite(e->u.rail.image_index)) { + ClrBit(e->info.misc_flags, EF_RAIL_FLIPS); + } + /* Skip wagons, there livery is defined via the engine */ if (e->type != VEH_TRAIN || e->u.rail.railveh_type != RAILVEH_WAGON) { LiveryScheme ls = GetEngineLiveryScheme(e->index, INVALID_ENGINE, NULL); -- cgit v1.2.3-54-g00ecf