changeset 19235:e8290cb0a4f8 draft

(svn r24124) -Add [FS#4658]: [NewGRF] Misc engine flag to disable breakdown smoke. (Hirundo)
author michi_cc <michi_cc@openttd.org>
date Tue, 17 Apr 2012 19:43:04 +0000
parents ee0796fc527e
children b1830cf1af9e
files src/engine_type.h src/vehicle.cpp
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/engine_type.h
+++ b/src/engine_type.h
@@ -157,6 +157,7 @@
 	EF_RAIL_FLIPS = 3, ///< Rail vehicle can be flipped in the depot
 	EF_AUTO_REFIT = 4, ///< Automatic refitting is allowed
 	EF_NO_DEFAULT_CARGO_MULTIPLIER = 5, ///< Use the new capacity algorithm. The default cargotype of the vehicle does not affect capacity multipliers. CB 15 is also called in purchase list.
+	EF_NO_BREAKDOWN_SMOKE          = 6, ///< Do not show black smoke during a breakdown.
 };
 
 /**
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -1146,7 +1146,7 @@
 						(this->type == VEH_TRAIN ? SND_3A_COMEDY_BREAKDOWN_2 : SND_35_COMEDY_BREAKDOWN), this);
 				}
 
-				if (!(this->vehstatus & VS_HIDDEN)) {
+				if (!(this->vehstatus & VS_HIDDEN) && !HasBit(EngInfo(this->engine_type)->misc_flags, EF_NO_BREAKDOWN_SMOKE)) {
 					EffectVehicle *u = CreateEffectVehicleRel(this, 4, 4, 5, EV_BREAKDOWN_SMOKE);
 					if (u != NULL) u->animation_state = this->breakdown_delay * 2;
 				}