Skip to content

Commit

Permalink
Validate if profile has already been converted
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchangelWTF committed Jul 8, 2024
1 parent 77830bf commit d25224b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions SPT.ProfileConverter/Converters/ThreeEightToThreeNine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ public override ConversionStatus ConvertProfile(string FullFilePath)
reader.FloatParseHandling = FloatParseHandling.Decimal;
var jsonObj = JObject.Load(reader);

if (jsonObj["info"]["ProfileConvertedFrom38"] != null)
{
return new ConversionStatus { Successful = false, Result = "This profile has already been converted!" };
}

// Add profile converted marker to the info object.
var info = jsonObj["info"];
if (info != null)
Expand Down

0 comments on commit d25224b

Please sign in to comment.