Changeset - r17256:73cfb62a14c7
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2011-02-07 09:50:20
rubidium@openttd.org
(svn r22006) -Fix [FS#4480]: smoke/sparks of trains would be shown under bridges, or rather through bridges
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/vehicle.cpp
Show inline comments
 
@@ -47,12 +47,13 @@
 
#include "core/backup_type.hpp"
 
#include "order_backup.h"
 
#include "sound_func.h"
 
#include "effectvehicle_func.h"
 
#include "effectvehicle_base.h"
 
#include "vehiclelist.h"
 
#include "bridge_map.h"
 
#include "tunnel_map.h"
 
#include "depot_map.h"
 

	
 
#include "table/strings.h"
 

	
 
#define GEN_HASH(x, y) ((GB((y), 6, 6) << 6) + GB((x), 7, 6))
 
@@ -2105,17 +2106,19 @@ void Vehicle::ShowVisualEffect() const
 
		byte effect_type = GB(v->vcache.cached_vis_effect, VE_TYPE_START, VE_TYPE_COUNT);
 
		bool disable_effect = HasBit(v->vcache.cached_vis_effect, VE_DISABLE_EFFECT);
 

	
 
		/* Show no smoke when:
 
		 * - Smoke has been disabled for this vehicle
 
		 * - The vehicle is not visible
 
		 * - The vehicle is under a bridge
 
		 * - The vehicle is on a depot tile
 
		 * - The vehicle is on a tunnel tile
 
		 * - The vehicle is a train engine that is currently unpowered */
 
		if (disable_effect ||
 
				v->vehstatus & VS_HIDDEN ||
 
				(MayHaveBridgeAbove(v->tile) && IsBridgeAbove(v->tile)) ||
 
				IsDepotTile(v->tile) ||
 
				IsTunnelTile(v->tile) ||
 
				(v->type == VEH_TRAIN &&
 
				!HasPowerOnRail(Train::From(v)->railtype, GetTileRailType(v->tile)))) {
 
			continue;
 
		}
0 comments (0 inline, 0 general)