src/aircraft_cmd.cpp
branch0.6
changeset 9353 1127b484af20
parent 9173 057e340d2e26
child 10324 adab4d41a259
equal deleted inserted replaced
9352:d7b2f0bbd0ec 9353:1127b484af20
  2133 }
  2133 }
  2134 
  2134 
  2135 static void AircraftEventHandler(Vehicle *v, int loop)
  2135 static void AircraftEventHandler(Vehicle *v, int loop)
  2136 {
  2136 {
  2137 	v->tick_counter++;
  2137 	v->tick_counter++;
  2138 	v->current_order_time++;
       
  2139 
  2138 
  2140 	if (v->vehstatus & VS_CRASHED) {
  2139 	if (v->vehstatus & VS_CRASHED) {
  2141 		HandleCrashedAircraft(v);
  2140 		HandleCrashedAircraft(v);
  2142 		return;
  2141 		return;
  2143 	}
  2142 	}
  2169 	if (!(this->vehstatus & VS_STOPPED)) this->running_ticks++;
  2168 	if (!(this->vehstatus & VS_STOPPED)) this->running_ticks++;
  2170 
  2169 
  2171 	if (this->subtype == AIR_HELICOPTER) HelicopterTickHandler(this);
  2170 	if (this->subtype == AIR_HELICOPTER) HelicopterTickHandler(this);
  2172 
  2171 
  2173 	AgeAircraftCargo(this);
  2172 	AgeAircraftCargo(this);
       
  2173 
       
  2174 	this->current_order_time++;
  2174 
  2175 
  2175 	for (uint i = 0; i != 2; i++) {
  2176 	for (uint i = 0; i != 2; i++) {
  2176 		AircraftEventHandler(this, i);
  2177 		AircraftEventHandler(this, i);
  2177 		if (this->type != VEH_AIRCRAFT) // In case it was deleted
  2178 		if (this->type != VEH_AIRCRAFT) // In case it was deleted
  2178 			break;
  2179 			break;