Skip to content

Commit 6221cca

Browse files
committed
Remove "any" gamepad if it was disconnected
1 parent eae79b5 commit 6221cca

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/GateEngine/System/HID/GamePad/GamePadManager.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ extension HID.GamePadManger {
5959
)
6060
gamePad.state = .disconnected
6161
all.removeAll(where: { $0 === gamePad })
62+
if self.any === gamePad {
63+
self.any = nullGamePad
64+
}
6265
}
6366
}
6467

0 commit comments

Comments
 (0)