Description
Let's just start with an example.
At first I defined an array
I have tested a lot of times and it was proved that the value of Array[2][1] always equals to that of Array[1][1] no matter how I try to make them two different elements.
Here is the code which I used for test
Reproducible
Always
What you were doing when the bug happened
Not doing anything
What you think caused the bug
Maybe squirrel language doesn't allow the existence of two-dimensional array?
Let's just start with an example.
At first I defined an array
Code Select
Array<-array(2,array(2,0));
And while I changed the value of Array[1][1] to 3, the value of Array[2][1] was also automatically changed to 3, which is not reasonable.I have tested a lot of times and it was proved that the value of Array[2][1] always equals to that of Array[1][1] no matter how I try to make them two different elements.
Here is the code which I used for test
Code Select
function onScriptLoad()
{
Array<-array(2,array(2,0));
}
function onPlayerCommand( player, cmd, text )
{
if(cmd=="change")
{
if(text&&IsNum(text))
{
Array[1][1]=text.tointeger();
}
}
else if(cmd=="check")
{
MessagePlayer("Array[2][1]: "+Array[2][1],player);
}
}
Reproducible
Always
What you were doing when the bug happened
Not doing anything
What you think caused the bug
Maybe squirrel language doesn't allow the existence of two-dimensional array?