diff --git a/Randomizer/Logic/Parser.cs b/Randomizer/Logic/Parser.cs index 07ea22aa..c2cfb7ad 100644 --- a/Randomizer/Logic/Parser.cs +++ b/Randomizer/Logic/Parser.cs @@ -75,8 +75,8 @@ public List GetDependencies(string logic) if (!StringUtil.ParseString(values[2], out depValue)) { depValue = 1; - dependencyString = dependencyString.Substring(0, dependencyString.Length - (values[2].Length + 1)); } + dependencyString = dependencyString.Substring(0, dependencyString.Length - (values[2].Length + 1)); } List temp = GetDependencies(dependencyString); @@ -435,8 +435,10 @@ public List ParseLocations(string[] lines, Random rng) // Probably a more efficient way to do it, but eh if (locationString.IndexOf("`") != -1) { - locationString = locationString.Replace("`RAND_INT`", StringUtil.AsStringHex8(rng.Next())); - + if (locationString.Contains("`RAND_INT`")) + { + locationString = locationString.Replace("`RAND_INT`", StringUtil.AsStringHex8(rng.Next())); + } locationString = SubParser.ReplaceDefines(locationString); }