assert(v->vehstatus & VS_STOPPED); // the vehicle should have been stopped in VehicleEnteredDepotThisTick() if needed
if (v->leave_depot_instantly) {
// we stopped the vehicle to do this, so we have to remember to start it again when we are done
// we need to store this info as the engine might be replaced and lose this info
stopped = true;
}
/* Remember the flag v->leave_depot_instantly because if we replace the vehicle, the vehicle holding this flag will be sold
* If it is set, then we only stopped the vehicle to replace it (if needed) and we will need to start it again.
* We also need to reset the flag since it should remain false except from when the vehicle enters a depot until autoreplace is handled in the same tick */