From ca0ae3d971eba3bcad6989b5d0339fe0c0359dce Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 28 Apr 2018 09:48:24 -0500 Subject: [PATCH] Make the bk2 SetControllersAsMnemonic implementation less bad. Fixes #1181 --- BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs b/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs index 026bfbcfb7..0fd295a010 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs @@ -172,11 +172,12 @@ namespace BizHawk.Client.Common } else if (def.FloatControls.Contains(key)) { - var temp = trimmed.Substring(iterator, 5); + var commaIndex = trimmed.Substring(iterator).IndexOf(','); + var temp = trimmed.Substring(iterator, commaIndex); var val = int.Parse(temp.Trim()); _myFloatControls[key] = val; - iterator += 6; + iterator += commaIndex + 1; } } }