From bb20e62435e74c04ea32df14084efc760f61338a Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 8 Oct 2020 01:13:51 +0900 Subject: [PATCH] examples/gamepad: Bug fix: Misuse of indices and gamepad IDs --- examples/gamepad/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gamepad/main.go b/examples/gamepad/main.go index be4097b22..cf1d1520e 100644 --- a/examples/gamepad/main.go +++ b/examples/gamepad/main.go @@ -91,7 +91,7 @@ func (g *Game) Draw(screen *ebiten.Image) { ids = append(ids, id) } sort.Ints(ids) - for id := range ids { + for _, id := range ids { str += fmt.Sprintf("Gamepad (ID: %d, SDL ID: %s):\n", id, ebiten.GamepadSDLID(id)) str += fmt.Sprintf(" Axes: %s\n", strings.Join(g.axes[id], ", ")) str += fmt.Sprintf(" Buttons: %s\n", strings.Join(g.pressedButtons[id], ", "))