src/aircraft_cmd.cpp
changeset 7493 07944c9e005f
parent 7492 35acee076719
child 7502 f821f134ec5a
equal deleted inserted replaced
7492:35acee076719 7493:07944c9e005f
   403 		}
   403 		}
   404 
   404 
   405 		v->u.air.state = HANGAR;
   405 		v->u.air.state = HANGAR;
   406 		v->u.air.previous_pos = v->u.air.pos;
   406 		v->u.air.previous_pos = v->u.air.pos;
   407 		v->u.air.targetairport = GetStationIndex(tile);
   407 		v->u.air.targetairport = GetStationIndex(tile);
   408 		v->next = u;
   408 		v->SetNext(u);
   409 
   409 
   410 		v->service_interval = _patches.servint_aircraft;
   410 		v->service_interval = _patches.servint_aircraft;
   411 
   411 
   412 		v->date_of_last_service = _date;
   412 		v->date_of_last_service = _date;
   413 		v->build_year = u->build_year = _cur_year;
   413 		v->build_year = u->build_year = _cur_year;
   426 		VehiclePositionChanged(u);
   426 		VehiclePositionChanged(u);
   427 
   427 
   428 		/* Aircraft with 3 vehicles (chopper)? */
   428 		/* Aircraft with 3 vehicles (chopper)? */
   429 		if (v->subtype == AIR_HELICOPTER) {
   429 		if (v->subtype == AIR_HELICOPTER) {
   430 			Vehicle *w = vl[2];
   430 			Vehicle *w = vl[2];
   431 
       
   432 			u->next = w;
       
   433 
   431 
   434 			w = new (w) Aircraft();
   432 			w = new (w) Aircraft();
   435 			w->direction = DIR_N;
   433 			w->direction = DIR_N;
   436 			w->owner = _current_player;
   434 			w->owner = _current_player;
   437 			w->x_pos = v->x_pos;
   435 			w->x_pos = v->x_pos;
   443 			w->cur_image = SPR_ROTOR_STOPPED;
   441 			w->cur_image = SPR_ROTOR_STOPPED;
   444 			w->random_bits = VehicleRandomBits();
   442 			w->random_bits = VehicleRandomBits();
   445 			/* Use rotor's air.state to store the rotor animation frame */
   443 			/* Use rotor's air.state to store the rotor animation frame */
   446 			w->u.air.state = HRS_ROTOR_STOPPED;
   444 			w->u.air.state = HRS_ROTOR_STOPPED;
   447 			w->UpdateDeltaXY(INVALID_DIR);
   445 			w->UpdateDeltaXY(INVALID_DIR);
       
   446 
       
   447 			u->SetNext(w);
   448 			VehiclePositionChanged(w);
   448 			VehiclePositionChanged(w);
   449 		}
   449 		}
   450 
   450 
   451 		InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
   451 		InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
   452 		RebuildVehicleLists();
   452 		RebuildVehicleLists();