mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-15 16:32:41 +01:00
@@ -2754,6 +2754,22 @@ static void SpawnAdvancedVisualEffect(const Vehicle *v)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if a bridge is above a vehicle.
|
||||
* @param v Vehicle to test.
|
||||
* @return true iff a bridge is above the vehicle.
|
||||
*/
|
||||
static bool IsBridgeAboveVehicle(const Vehicle *v)
|
||||
{
|
||||
if (IsBridgeTile(v->tile)) {
|
||||
/* If the vehicle is 'on' a bridge tile, check the real position of the vehicle. If it's different then the
|
||||
* vehicle is on the middle of the bridge, which cannot have a bridge above. */
|
||||
TileIndex tile = TileVirtXY(v->x_pos, v->y_pos);
|
||||
if (tile != v->tile) return false;
|
||||
}
|
||||
return IsBridgeAbove(v->tile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw visual effects (smoke and/or sparks) for a vehicle chain.
|
||||
* @pre this->IsPrimaryVehicle()
|
||||
@@ -2817,7 +2833,7 @@ void Vehicle::ShowVisualEffect() const
|
||||
* - The vehicle is a train engine that is currently unpowered */
|
||||
if (effect_model == VESM_NONE ||
|
||||
v->vehstatus.Test(VehState::Hidden) ||
|
||||
IsBridgeAbove(v->tile) ||
|
||||
IsBridgeAboveVehicle(v) ||
|
||||
IsDepotTile(v->tile) ||
|
||||
IsTunnelTile(v->tile) ||
|
||||
(v->type == VEH_TRAIN &&
|
||||
|
||||
Reference in New Issue
Block a user