Skip to content

Commit

Permalink
Fixed new parameters
Browse files Browse the repository at this point in the history
Fixed empty parameters
Fixed indexing with parameters
Cleaned up variable names
  • Loading branch information
McTwist committed Feb 14, 2018
1 parent 91b7f1f commit ab0fd62
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions script.cs
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ function EventScript_fromScript(%script, %error)

%data = trim(getSubStr(%script, %i, %n - %i));
%list.value[%list.count, "outputEventName"] = %data;
%list.value[%list.count, "params"] |= 0;

%i = %n;

Expand Down Expand Up @@ -551,7 +552,6 @@ function EventScript_fromScript(%script, %error)
%data = strReplace(%data, "\\\\", "\\");

// Append list
%list.value[%list.count, "params"] |= 0;
%list.value[%list.count, "params", %list.value[%list.count, "params"]] = %data;
%list.value[%list.count, "params"]++;

Expand Down Expand Up @@ -607,9 +607,11 @@ function EventScript_fromScript(%script, %error)
// Set default values for table element
%indexTableLine[%indexTableCount] = %line;
%indexTableIndex[%indexTableCount] = %list.count;
%indexTableParam[%indexTableCount] = getFieldCount(%list.value[%list.count, "param"]);
%indexTableParam[%indexTableCount] = %list.value[%list.count, "params"];
%indexTableListCount[%indexTableCount] = 0;

%list.value[%list.count, "params"]++;

%state = 4;

// Number / Boolean / Naked string
Expand Down Expand Up @@ -672,7 +674,6 @@ function EventScript_fromScript(%script, %error)
%data = trim(getSubStr(%script, %i, %n - %i));

// Append list
%list.value[%list.count, "params"] |= 0;
%list.value[%list.count, "params", %list.value[%list.count, "params"]] = %data;
%list.value[%list.count, "params"]++;

Expand Down Expand Up @@ -874,9 +875,9 @@ function EventScript_fromScript(%script, %error)
{
%line = %indexTableLine[%i];
%index = %indexTableIndex[%i];
%param = %indexTableParam[%i];
%paramIndex = %indexTableParam[%i];

%params = "";
%value = "";

%l = -1;
for (%n = 0; %n < %indexTableListCount[%i]; %n++)
Expand Down Expand Up @@ -909,7 +910,7 @@ function EventScript_fromScript(%script, %error)
// Indexing
case 0:

%params = setWord(%params, %l++, %var);
%value = setWord(%value, %l++, %var);

// Range start
case 1:
Expand All @@ -929,11 +930,11 @@ function EventScript_fromScript(%script, %error)
}

for (%m = %start; %m <= %var; %m++)
%params = setWord(%params, %l++, %m);
%value = setWord(%value, %l++, %m);
}
}

%list.value[%index, "params", %param] = %params;
%list.value[%index, "params", %paramIndex] = %value;
}

return %list;
Expand Down

0 comments on commit ab0fd62

Please sign in to comment.