LilyPad: Fix regression in configure binding (#1426)

Fixes regression introduced by the pop'n music controller support PR.

When modifying the axis direction combo box in the Configure Binding
group, the modified binding's info would get deleted and replaced by the
next binding's info. This results in incorrect info being passed to
BindCommand().

This commit reverts the incorrect code so the binding info is backed up
before deletion takes place, therefore ensuring the correct info is
passed to BindCommand().
This commit is contained in:
FlatOutPS2 2016-06-21 23:54:52 +02:00 committed by Jonathan Li
parent dce67351f9
commit 896730ceda
1 changed files with 2 additions and 1 deletions

View File

@ -1474,8 +1474,9 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l
const static unsigned int axisUIDs[3] = {UID_AXIS_NEG, UID_AXIS_POS, UID_AXIS};
int uid = dev->virtualControls[b->controlIndex].uid;
uid = (uid&0x00FFFFFF) | axisUIDs[cbsel];
Binding backup = *b;
DeleteSelected(port, slot);
int index = BindCommand(dev, uid, port, slot, b->command, b->sensitivity, b->turbo, b->deadZone);
int index = BindCommand(dev, uid, port, slot, backup.command, backup.sensitivity, backup.turbo, backup.deadZone);
ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED);
PropSheet_Changed(hWndProp, hWnd);
}