Skip to content

Commit fc69d39

Browse files
committed
Avoided double parsing for three coords
1 parent d402917 commit fc69d39

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

Assets/Story Generator/Scripts/ScriptExecution.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4328,18 +4328,21 @@ private static ScriptLine ParseLineForChar(int charIndex, string line, int lineN
43284328
{
43294329
// 2.5,3.4,1.5
43304330
paramList.Add(Tuple.Create(m.Groups[0].Value, 0));
4331-
}
4332-
4333-
// Parse position x,z
4334-
r = new Regex(pattPosXZ);
4335-
m = r.Match(sentence);
4336-
4337-
if (m.Success)
4331+
} else
43384332
{
4339-
// 2.5,3.4
4340-
paramList.Add(Tuple.Create(m.Groups[0].Value, 0));
4333+
// Parse position x,z
4334+
r = new Regex(pattPosXZ);
4335+
m = r.Match(sentence);
4336+
4337+
if (m.Success)
4338+
{
4339+
// 2.5,3.4
4340+
paramList.Add(Tuple.Create(m.Groups[0].Value, 0));
4341+
}
43414342
}
43424343

4344+
4345+
43434346

43444347
InteractionType action = (InteractionType)Enum.Parse(typeof(InteractionType), actionStr, true);
43454348
return new ScriptLine() { Interaction = action, Parameters = paramList, LineNumber = lineNo, modifier = modifier };

0 commit comments

Comments
 (0)