diff --git a/src/libs/joystick/protocols/mavlink-manual-control.ts b/src/libs/joystick/protocols/mavlink-manual-control.ts index c82a6727a..60de7d3f0 100644 --- a/src/libs/joystick/protocols/mavlink-manual-control.ts +++ b/src/libs/joystick/protocols/mavlink-manual-control.ts @@ -565,7 +565,7 @@ export class MavlinkManualControlManager { } else { const mavlinkActionValue = this.vehicleButtonParameterTable.find((e) => e.title === actionId) if (mavlinkActionValue === undefined) return - this.vehicle?.setParameter({ id: unnecessaryVehicleRegularButtons[indexRegularButtonToUse].button, value: mavlinkActionValue.value }) + this.vehicle?.setParameter({ id: unnecessaryVehicleRegularButtons[unnecessaryVehicleRegularButtons.length - 1].button, value: mavlinkActionValue.value }) } indexRegularButtonToUse++ }) @@ -578,7 +578,7 @@ export class MavlinkManualControlManager { } else { const mavlinkActionValue = this.vehicleButtonParameterTable.find((e) => e.title === actionId) if (mavlinkActionValue === undefined) return - this.vehicle?.setParameter({ id: unnecessaryVehicleShiftButtons[indexShiftButtonToUse].button, value: mavlinkActionValue.value }) + this.vehicle?.setParameter({ id: unnecessaryVehicleShiftButtons[unnecessaryVehicleShiftButtons.length - 1].button, value: mavlinkActionValue.value }) } indexShiftButtonToUse++ })