Skip to content
This repository was archived by the owner on Aug 7, 2022. It is now read-only.

Commit

Permalink
Fixed ArgumentOutOfRangeException for FunctionSelect
Browse files Browse the repository at this point in the history
  • Loading branch information
erri120 committed Nov 28, 2019
1 parent 986e70d commit d8239ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
5 changes: 4 additions & 1 deletion OMODFramework.Test/ScriptTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@ public class ScriptTest : DownloadTest
[TestMethod]
public void TestOBMMScript()
{

var omod = new OMOD(FileName);

Assert.IsNotNull(omod);

var scriptFunctions = new ScriptFunctions();

omod.RunScript(scriptFunctions);
var srd = omod.RunScript(scriptFunctions);

Assert.IsNotNull(srd);
}
}
}
11 changes: 4 additions & 7 deletions OMODFramework/Scripting/OBMMScriptHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,6 @@ internal static ScriptReturnData Execute(string inputScript, string dataPath, st
case "Continue":
case "Exit":
break;
default:
Warn($"Unrecognized function: {line[0]}!");
break;
}
}
else
Expand Down Expand Up @@ -1015,15 +1012,15 @@ private static string[] FunctionSelect(IList<string> line, bool isMultiSelect, b

for (var i = 0; i < line.Count / argsPerOption; i++)
{
items[i] = line[i * argsPerOption];
items.Add(line[i * argsPerOption]);
if (hasPreviews)
{
previews[i] = line[i * argsPerOption + 1];
if (hasDescriptions) descriptions[i] = line[i * argsPerOption + 2];
previews.Add(line[i * argsPerOption + 1]);
if (hasDescriptions) descriptions.Add(line[i * argsPerOption + 2]);
}
else
{
if (hasDescriptions) descriptions[i] = line[i * argsPerOption + 1];
if (hasDescriptions) descriptions.Add(line[i * argsPerOption + 1]);
}
}

Expand Down

0 comments on commit d8239ac

Please sign in to comment.