Before, partially changed key bindings were kept even if keyboard
customization was aborted by pressing the "Escape" key during the
process. Now, the old key bindings are restored in this case.
{
Key key = GetEventKey((KeyEvent *)&event, FALSE);
+ /* press 'Escape' to abort and keep the old key bindings */
if (key == KSYM_Escape)
{
FadeSkipNextFadeIn();
finished = TRUE;
+
break;
}
BackToFront();
}
- /* write new key bindings back to player setup */
- setup.input[player_nr].key = custom_key;
+ /* write new key bindings back to player setup, if successfully finished */
+ if (success)
+ setup.input[player_nr].key = custom_key;
return success;
}