Skip to content

Commit

Permalink
trim conditionals in naming pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
cadaei committed Dec 1, 2019
1 parent 8f9b6bb commit 9221104
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ARKBreedingStats/uiControls/NamePatterns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private static string ResolveConditions(Creature creature, string pattern)
{
// a conditional expression looks like {{#if:conditional-keyword|result if true|result if false}}, e.g. {{#if:IsTopHP|{HP}H}}

Regex r = new Regex(@"\{\{#if:(istop\w+) ?\| ?([^\|]+?)(?: ?\| ?(.+?))?\}\}");
Regex r = new Regex(@"\{\{#if: *(istop\w+) *\| *([^\|]+?)(?: *\| *(.+?))? *\}\}");
return r.Replace(pattern.ToLower(), (m) => ResolveCondition(creature, m));
}

Expand Down Expand Up @@ -229,7 +229,7 @@ public static Dictionary<string, string> CreateTokenDictionary(Creature creature
var levelOrder = new List<Tuple<int, int>>(values.Values.STATS_COUNT);
for (int si = 0; si < values.Values.STATS_COUNT; si++)
{
if (si != (int)StatNames.Torpidity)
if (si != (int)StatNames.Torpidity && creature.Species.UsesStat(si))
levelOrder.Add(new Tuple<int, int>(si, creature.levelsWild[si]));
}
levelOrder = levelOrder.OrderByDescending(l => l.Item2).ToList();
Expand Down

0 comments on commit 9221104

Please sign in to comment.