make controls processing more resilient against malformed binding strings

This commit is contained in:
beirich 2011-02-20 06:49:16 +00:00
parent 840f81f956
commit 957cf69bae
1 changed files with 3 additions and 0 deletions

View File

@ -30,6 +30,9 @@ namespace BizHawk.MultiClient
private static bool IsPressedSingle(string control)
{
if (string.IsNullOrEmpty(control))
return false;
if (control.StartsWith("J1 ")) return GetGamePad(0, control.Substring(3));
if (control.StartsWith("J2 ")) return GetGamePad(1, control.Substring(3));
if (control.StartsWith("J3 ")) return GetGamePad(2, control.Substring(3));