From e51ff6d7e2f6d24000a064ff8a1db79ff9246ba8 Mon Sep 17 00:00:00 2001 From: MaikyM <51415805+MaikyM@users.noreply.github.com> Date: Sat, 16 Nov 2019 01:25:26 -0600 Subject: [PATCH] Fixed files with the word "Game" due to FortnitePath, eg: SPID_051_GameOver. --- FModel/Methods/Utilities/FoldersUtility.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/FModel/Methods/Utilities/FoldersUtility.cs b/FModel/Methods/Utilities/FoldersUtility.cs index f886e8fc..adcf3b37 100644 --- a/FModel/Methods/Utilities/FoldersUtility.cs +++ b/FModel/Methods/Utilities/FoldersUtility.cs @@ -1,6 +1,7 @@ -using System; +using System; using System.Diagnostics; using System.IO; +using System.Text.RegularExpressions; using FProp = FModel.Properties.Settings; namespace FModel.Methods.Utilities @@ -91,7 +92,8 @@ namespace FModel.Methods.Utilities public static string FixFortnitePath(string path) { - string fixedPath = path.Replace("Game", "FortniteGame/Content"); + Regex regexGame = new Regex(Regex.Escape("Game")); + string fixedPath = regexGame.Replace(path, "FortniteGame/Content", 1); int sep = fixedPath.LastIndexOf('.'); return fixedPath.Substring(0, sep > 0 ? sep : fixedPath.Length); }