CyclopsMC / IntegratedScripting

Create scripts for handling complex operations in Integrated Dynamics
MIT License
9 stars 1 forks source link

Leaving a variable card in the store referencing a function and you delete everything except a parentheses or brackets the server crashes #17

Open Ajikozau opened 5 days ago

Ajikozau commented 5 days ago

Issue type:


Short description:

Whenever you leave a variable card inside a variable store with a reference to a script variable, have the variable card applied to another card and the third card is active in the network and delete all the function except a parentheses or curly brackets (haven't tried anything else) the server crashes. In the modpack I'm currently playing on it removes the display and the inserted card from the game.

Steps to reproduce the problem:

Expected behaviour:

The display throws an error.


Versions:

Log file:

Sorry don't have a log for this because I was testing out stuff and lost the log in the process.

Ajikozau commented 5 days ago

Incidentally this was the function I was playing around with

function test(list, filters) {
  let filteredList = [];
  for (i = 0; i < filters.length; i++) {
    let filterName = idContext.ops.uniquely_namedUniqueName(filters[i]);
    for (i2 = 0; i2 < list.length; i2++) {
      let itemName = idContext.ops.uniquely_namedUniqueName(list[i2]);
      if (filterName === itemName) {
        filteredList.push(filters[i]);
      }
    }
  }
  return filteredList;
}