Skip to content

Commit 7cb4f3c

Browse files
committed
fixed error where offsets wouldn't be taken into account
1 parent 9e775db commit 7cb4f3c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

gcadapter.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,14 @@ func (adapter *GCAdapter) step() error {
194194
}
195195

196196
for PORT, controller := range controllers {
197-
if adapter.controllers[PORT].PluggedIn != adapter.offsets[PORT].PluggedIn {
198-
adapter.offsets[PORT].PluggedIn = adapter.controllers[PORT].PluggedIn
199-
adapter.offsets[PORT].StickX = adapter.controllers[PORT].StickX
200-
adapter.offsets[PORT].StickY = adapter.controllers[PORT].StickY
201-
adapter.offsets[PORT].CX = adapter.controllers[PORT].CX
202-
adapter.offsets[PORT].CY = adapter.controllers[PORT].CY
203-
adapter.offsets[PORT].LAnalog = adapter.controllers[PORT].LAnalog
204-
adapter.offsets[PORT].RAnalog = adapter.controllers[PORT].RAnalog
197+
if adapter.offsets[PORT].PluggedIn != controllers[PORT].PluggedIn {
198+
adapter.offsets[PORT].PluggedIn = controllers[PORT].PluggedIn
199+
adapter.offsets[PORT].StickX = controllers[PORT].StickX
200+
adapter.offsets[PORT].StickY = controllers[PORT].StickY
201+
adapter.offsets[PORT].CX = controllers[PORT].CX
202+
adapter.offsets[PORT].CY = controllers[PORT].CY
203+
adapter.offsets[PORT].LAnalog = controllers[PORT].LAnalog
204+
adapter.offsets[PORT].RAnalog = controllers[PORT].RAnalog
205205
}
206206
adapter.mutex.Lock()
207207
adapter.controllers[PORT] = controller

0 commit comments

Comments
 (0)