summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-02-13 19:49:53 +0000
committerrubidium <rubidium@openttd.org>2011-02-13 19:49:53 +0000
commit6a58f3487860dafde6f9b3653e75b78f74108f02 (patch)
treea6fe1e1e5ee57de809157f7c29bbd336f1e91a0b /src
parentc7038d8b4d7d68d4a43a59360e7046a62586c5c9 (diff)
downloadopenttd-6a58f3487860dafde6f9b3653e75b78f74108f02.tar.xz
(svn r22072) -Fix (r21966): flipping wasn't (correctly) disabled in some cases
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp9
1 files changed, 9 insertions, 0 deletions
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);