* 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. */
| 1478 | * is actually on the ground inside a depot. |
| 1479 | */ |
| 1480 | void 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 //////////////////////////////// |
no test coverage detected