MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / AircraftLeaveHangar

Function AircraftLeaveHangar

src/aircraft_cmd.cpp:1480–1504  ·  view source on GitHub ↗

* Aircraft is about to leave the hangar. * @param v Aircraft leaving. * @param exit_dir The direction the vehicle leaves the hangar. * @note This function is called in AfterLoadGame for old savegames, so don't rely * on any data to be valid, especially don't rely on the fact that the vehicle * is actually on the ground inside a depot. */

Source from the content-addressed store, hash-verified

1478 * is actually on the ground inside a depot.
1479 */
1480void AircraftLeaveHangar(Aircraft *v, Direction exit_dir)
1481{
1482 v->cur_speed = 0;
1483 v->subspeed = 0;
1484 v->progress = 0;
1485 v->direction = exit_dir;
1486 v->vehstatus.Reset(VehState::Hidden);
1487 {
1488 Vehicle *u = v->Next();
1489 u->vehstatus.Reset(VehState::Hidden);
1490
1491 /* Rotor blades */
1492 u = u->Next();
1493 if (u != nullptr) {
1494 u->vehstatus.Reset(VehState::Hidden);
1495 u->cur_speed = 80;
1496 }
1497 }
1498
1499 VehicleServiceInDepot(v);
1500 v->LeaveUnbunchingDepot();
1501 SetAircraftPosition(v, v->x_pos, v->y_pos, v->z_pos);
1502 InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
1503 SetWindowClassesDirty(WC_AIRCRAFT_LIST);
1504}
1505
1506////////////////////////////////////////////////////////////////////////////////
1507/////////////////// AIRCRAFT MOVEMENT SCHEME ////////////////////////////////

Callers 2

UpdateOldAircraftFunction · 0.85

Calls 7

VehicleServiceInDepotFunction · 0.85
SetAircraftPositionFunction · 0.85
SetWindowClassesDirtyFunction · 0.85
LeaveUnbunchingDepotMethod · 0.80
InvalidateWindowDataFunction · 0.70
ResetMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected