Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
Fixed Jays2Kings stick dead zone migration check. Carry over non-zero…
Browse files Browse the repository at this point in the history
… dead zone choice
  • Loading branch information
Ryochan7 committed Dec 31, 2023
1 parent 1ecdcc2 commit a06b750
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions DS4Windows/DS4Control/ProfileMigration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,15 @@ private string Version0002Migration()
{
string lsdead = profileReader.ReadElementContentAsString();
bool valid = int.TryParse(lsdead, out int temp);
if (valid && temp <= 0)
if (valid)
{
temp = 10;
// Add default deadzone if a 0 dead zone was set in profile.
// Jays2Kings used implicit dead zones in the mapper code
if (temp <= 0)
{
temp = StickDeadZoneInfo.DEFAULT_DEADZONE;
}

tempWriter.WriteElementString("LSDeadZone", temp.ToString());
}

Expand All @@ -446,14 +452,21 @@ private string Version0002Migration()
{
string rsdead = profileReader.ReadElementContentAsString();
bool valid = int.TryParse(rsdead, out int temp);
if (valid && temp <= 0)
if (valid)
{
temp = 10;
// Add default deadzone if a 0 dead zone was set in profile.
// Jays2Kings used implicit dead zones in the mapper code
if (temp <= 0)
{
temp = StickDeadZoneInfo.DEFAULT_DEADZONE;
}

tempWriter.WriteElementString("RSDeadZone", temp.ToString());
}

break;
}

default:
tempWriter.WriteNode(profileReader, true);
break;
Expand Down

0 comments on commit a06b750

Please sign in to comment.