File diff r15311:7b8605e255cf → r15312:e63ca178d21b
src/vehicle.cpp
Show inline comments
 
@@ -166,12 +166,14 @@ bool Vehicle::NeedsAutomaticServicing() 
 
uint Vehicle::Crash(bool flooded)
 
{
 
	assert((this->vehstatus & VS_CRASHED) == 0);
 
	assert(this->Previous() == NULL); // IsPrimaryVehicle fails for free-wagon-chains
 

	
 
	uint pass = 0;
 
	/* Stop the vehicle. */
 
	if (this->IsPrimaryVehicle()) this->vehstatus |= VS_STOPPED;
 
	/* crash all wagons, and count passengers */
 
	for (Vehicle *v = this; v != NULL; v = v->Next()) {
 
		if (IsCargoInClass(v->cargo_type, CC_PASSENGERS)) pass += v->cargo.Count();
 
		v->vehstatus |= VS_CRASHED;
 
		MarkSingleVehicleDirty(v);
 
	}