Skip to content

Commit

Permalink
Fixed senstivity errors, causing crashes when editing profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Jays2Kings committed Oct 9, 2016
1 parent 35d2a27 commit ad0d2f8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
11 changes: 8 additions & 3 deletions DS4Windows.sln
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS4Windows", "DS4Windows\DS4Windows.csproj", "{7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Debug|x64.ActiveCfg = Debug|Any CPU
{7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Debug|x64.Build.0 = Debug|Any CPU
{7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Release|Any CPU.Build.0 = Release|Any CPU
{7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Release|x64.ActiveCfg = Release|Any CPU
{7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
18 changes: 12 additions & 6 deletions DS4Windows/DS4Control/ScpUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1398,12 +1398,18 @@ public Boolean LoadProfile(int device, bool launchprogram, ControlService contro
string[] s = Item.InnerText.Split('|');
if (s.Length == 1)
s = Item.InnerText.Split(',');
double.TryParse(s[0], out LSSens[device]);
double.TryParse(s[1], out RSSens[device]);
double.TryParse(s[2], out l2Sens[device]);
double.TryParse(s[3], out r2Sens[device]);
double.TryParse(s[4], out SXSens[device]);
double.TryParse(s[5], out SZSens[device]);
if (!double.TryParse(s[0], out LSSens[device]) || LSSens[device] < .5f)
LSSens[device] = 1;
if (!double.TryParse(s[1], out RSSens[device]) || RSSens[device] < .5f)
RSSens[device] = 1;
if (!double.TryParse(s[2], out l2Sens[device]) || l2Sens[device] < .5f)
l2Sens[device] = 1;
if (!double.TryParse(s[3], out r2Sens[device]) || r2Sens[device] < .5f)
r2Sens[device] = 1;
if (!double.TryParse(s[4], out SXSens[device]) || SXSens[device] < .5f)
SXSens[device] = 1;
if (!double.TryParse(s[5], out SZSens[device]) || SZSens[device] < .5f)
SZSens[device] = 1;
}
catch { missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/ChargingType"); int.TryParse(Item.InnerText, out chargingType[device]); }
Expand Down
2 changes: 1 addition & 1 deletion DS4Windows/DS4Forms/Options.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ad0d2f8

Please sign in to comment.