Fix an InvalidCastException being thrown when a double is unboxed as a float (#1863)

This commit is contained in:
Devon R 2020-02-25 17:33:28 +00:00 committed by GitHub
parent 0962771225
commit 0f7d292101
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ namespace BizHawk.Client.Common
public void SetAnalog(LuaTable controls, object controller = null)
{
var dict = new Dictionary<string, float>();
foreach (var k in controls.Keys) dict[k.ToString()] = (float) controls[k];
foreach (var k in controls.Keys) dict[k.ToString()] = Convert.ToSingle(controls[k]);
APIs.Joypad.SetAnalog(dict, controller);
}
}