forked from ground/ground
Fix a couple small things
This commit is contained in:
@@ -656,7 +656,7 @@ Literal exec(vector<Instruction> in, bool executingFunction) {
|
||||
saves them to a list (vector) with name listName.
|
||||
*/
|
||||
case Instructions::Setlist:
|
||||
if (l.args.size() < 2) {
|
||||
if (l.args.size() < 1) {
|
||||
error("Could not find all arguments required for Setlist inbuilt");
|
||||
}
|
||||
{
|
||||
@@ -726,10 +726,10 @@ Literal exec(vector<Instruction> in, bool executingFunction) {
|
||||
error("Index " + to_string(ref) + " out of range of list " + listref.listName);
|
||||
}
|
||||
} else {
|
||||
error("Unknown list: " + listref.listName);
|
||||
error("Found a normal variable in place of a list");
|
||||
}
|
||||
} else {
|
||||
error("Found a normal variable in place of a list");
|
||||
error("Unknown list: " + listref.listName);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -857,6 +857,9 @@ Literal exec(vector<Instruction> in, bool executingFunction) {
|
||||
}
|
||||
|
||||
if (variables.find(listref.listName) != variables.end()) {
|
||||
if (!holds_alternative<List>(variables[listref.listName].val)) {
|
||||
error("Variable " + listref.listName + "is not a list");
|
||||
}
|
||||
List tmpList = get<List>(variables[listref.listName].val);
|
||||
tmpList.val.push_back(value);
|
||||
variables[listref.listName].val = tmpList;
|
||||
|
Reference in New Issue
Block a user