Lua: Fixed a bug with analog controls not being cleared
This commit is contained in:
parent
556b7b0123
commit
c2096d9a30
|
@ -172,23 +172,24 @@ namespace BizHawk.Client.Common
|
||||||
foreach (var name in controls.Keys)
|
foreach (var name in controls.Keys)
|
||||||
{
|
{
|
||||||
var theValueStr = controls[name].ToString();
|
var theValueStr = controls[name].ToString();
|
||||||
|
float? theValue = null;
|
||||||
|
|
||||||
if (!String.IsNullOrWhiteSpace(theValueStr))
|
if (!String.IsNullOrWhiteSpace(theValueStr))
|
||||||
{
|
{
|
||||||
try
|
float f;
|
||||||
{
|
if (float.TryParse(theValueStr, out f))
|
||||||
var theValue = float.Parse(theValueStr);
|
theValue = f;
|
||||||
if (controller == null)
|
|
||||||
{
|
|
||||||
Global.StickyXORAdapter.SetFloat(name.ToString(), theValue);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Global.StickyXORAdapter.SetFloat("P" + controller + " " + name, theValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (controller == null)
|
||||||
|
{
|
||||||
|
Global.StickyXORAdapter.SetFloat(name.ToString(), theValue);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Global.StickyXORAdapter.SetFloat("P" + controller + " " + name, theValue);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch { /*Eat it*/ }
|
catch { /*Eat it*/ }
|
||||||
|
|
Loading…
Reference in New Issue