|
@@ -2005,13 +2005,13 @@ static void HandleLocomotiveSmokeCloud(c
|
|
|
* maximum speed no diesel_smoke is emitted as train has enough traction to keep locomotive running optimally.
|
|
|
* REGULATION:
|
|
|
* - up to which speed a diesel train is emitting smoke (with reduced/small setting only until 1/2 of max_speed),
|
|
|
* - in Chance16 - the last value is 512 / 2^smoke_amount (max. smoke when 128 = smoke_amount of 2). */
|
|
|
if (u->cur_speed < (u->vcache.cached_max_speed >> (2 >> _settings_game.vehicle.smoke_amount)) &&
|
|
|
Chance16((64 - ((u->cur_speed << 5) / u->vcache.cached_max_speed) + (32 >> (u->acc_cache.cached_power >> 10)) - (32 >> (u->acc_cache.cached_weight >> 9))), (512 >> _settings_game.vehicle.smoke_amount))) {
|
|
|
CreateEffectVehicleRel(v, 0, 0, 10, EV_DIESEL_SMOKE);
|
|
|
CreateEffectVehicleRel(v, x, y, 10, EV_DIESEL_SMOKE);
|
|
|
sound = true;
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
case 2:
|
|
|
/* Electric train's spark - more often occurs when train is departing (more load)
|
|
@@ -2019,13 +2019,13 @@ static void HandleLocomotiveSmokeCloud(c
|
|
|
* emissions are kept simple. Only when starting, creating huge force are sparks more likely to happen, but when
|
|
|
* reaching its max. speed, quarter by quarter of it, chance decreases untill the usuall 2,22% at train's top speed.
|
|
|
* REGULATION:
|
|
|
* - in Chance16 the last value is 360 / 2^smoke_amount (max. sparks when 90 = smoke_amount of 2). */
|
|
|
if (GB(v->tick_counter, 0, 2) == 0 &&
|
|
|
Chance16((6 - ((u->cur_speed << 2) / u->vcache.cached_max_speed)), (360 >> _settings_game.vehicle.smoke_amount))) {
|
|
|
CreateEffectVehicleRel(v, 0, 0, 10, EV_ELECTRIC_SPARK);
|
|
|
CreateEffectVehicleRel(v, x, y, 10, EV_ELECTRIC_SPARK);
|
|
|
sound = true;
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
break;
|