Changeset - r20225:f2d46c58f3df
[Not reviewed]
master
0 1 0
frosch - 11 years ago 2013-05-06 14:57:42
frosch@openttd.org
(svn r25225) -Fix: [NewGRF] Play vehicle sound effect also for planes.
1 file changed with 17 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/vehicle.cpp
Show inline comments
 
@@ -887,15 +887,29 @@ void CallVehicleTicks()
 
					if (--v->cargo_age_counter == 0) {
 
						v->cargo.AgeCargo();
 
						v->cargo_age_counter = v->vcache.cached_cargo_age_period;
 
					}
 
				}
 

	
 
				if (v->type == VEH_TRAIN && Train::From(v)->IsWagon()) continue;
 
				if (v->type == VEH_AIRCRAFT && v->subtype != AIR_HELICOPTER) continue;
 
				if (v->type == VEH_ROAD && !RoadVehicle::From(v)->IsFrontEngine()) continue;
 
				/* Check vehicle sounds */
 
				switch (v->type) {
 
					case VEH_TRAIN:
 
						if (Train::From(v)->IsWagon()) continue;
 
						break;
 

	
 
					case VEH_ROAD:
 
						if (!RoadVehicle::From(v)->IsFrontEngine()) continue;
 
						break;
 

	
 
					case VEH_AIRCRAFT:
 
						if (!Aircraft::From(v)->IsNormalAircraft()) continue;
 
						break;
 

	
 
					default:
 
						break;
 
				}
 

	
 
				v->motion_counter += front->cur_speed;
 
				/* Play a running sound if the motion counter passes 256 (Do we not skip sounds?) */
 
				if (GB(v->motion_counter, 0, 8) < front->cur_speed) PlayVehicleSound(v, VSE_RUNNING);
 

	
 
				/* Play an alternating running sound every 16 ticks */
0 comments (0 inline, 0 general)