I got a problem I am currently stuck on. Essentially what I want to do is I want to have a variable array, have that be overwritten, saying it to a different variable, then having the initial variable be overwritten again, saving it to yet again a different variable and comparing the two saved variables.
The code in mind goes as follows:
int[] Item1 = {1,1}
int[] SavedItem1;
int[] SavedItem2;
Program1();
SavedItem1 = Item1;
Program2();
SavedItem2 = Item1;
player.sm("The value is: " + SavedItem1[0] + " and " + SavedItem2[0] + ".");
public static void Program1() { Item1 = {2,2,2,2,2};}
public static void Program2() { Item1 = {3,4,4,5,5};}
but what this returns ingame is: The value is 1 and 1, clearly it does not overwrite the value in the programs, I don't understand why not and I don't know how to solve this problem, what would be the correct way to do what I am trying to do here? (The correct output is: The value is 2 and 3.)
Thank you all
-Antoine