Fix the ability to set other player's gamepad value

This commit is contained in:
Ethan O'Brien 2023-08-16 19:22:35 -05:00
parent 91d1d279e4
commit aa6fd8be02
2 changed files with 3 additions and 2 deletions

View file

@ -2450,7 +2450,8 @@ class EmulatorJS {
if (this.controlPopup.parentElement.parentElement.getAttribute("hidden") === null) {
if ('buttonup' === e.type || (e.type === "axischanged" && value === 0)) return;
const num = this.controlPopup.getAttribute("button-num");
const player = this.controlPopup.getAttribute("player-num");
const player = parseInt(this.controlPopup.getAttribute("player-num"));
if (e.gamepadIndex !== player) return;
if (!this.controls[player][num]) {
this.controls[player][num] = {};
}

File diff suppressed because one or more lines are too long