pkmnfrk
01-11-2010, 03:24 PM
Uhm...
int GlobalArray[10];
ffc script Test {
void run() {
eweapon ew = Screen->CreateEWeapon(EW_FIREBALL);
//the other properties are not important.
ew->Misc[1] = 1;
GlobalArray[ew->Misc[1]] = Rand(10);
Trace(ew->Misc[1]); //1.0000
Trace(GlobalArray[ew->Misc[1]]); //0.0000
int i = ew->Misc[1];
Trace(GlobalArray[i]); //1.0000
}
}
Basically, in a script I'm writing, I put the index of a global array into an eweapon's Misc array. Then, later, I reference that global array by directly indexing the global array with the Misc array (as I do in the above script). However, it doesn't work. Lifting it into a separate variable does work, however.
Note: I haven't tested this exact test case. However, if it doesn't work, I'll drop in the actual script which suffers from this bug.
int GlobalArray[10];
ffc script Test {
void run() {
eweapon ew = Screen->CreateEWeapon(EW_FIREBALL);
//the other properties are not important.
ew->Misc[1] = 1;
GlobalArray[ew->Misc[1]] = Rand(10);
Trace(ew->Misc[1]); //1.0000
Trace(GlobalArray[ew->Misc[1]]); //0.0000
int i = ew->Misc[1];
Trace(GlobalArray[i]); //1.0000
}
}
Basically, in a script I'm writing, I put the index of a global array into an eweapon's Misc array. Then, later, I reference that global array by directly indexing the global array with the Misc array (as I do in the above script). However, it doesn't work. Lifting it into a separate variable does work, however.
Note: I haven't tested this exact test case. However, if it doesn't work, I'll drop in the actual script which suffers from this bug.