Greetings,
I have an odd case where I have a chain of else-if's, and a variable declared in one elif is in the same scope as another. Am I not fully understanding scope, or is it just not a good idea to program at 8am?
Code:
....
else if (strfind(name, "numberoflevels") != -1) {
if (consistent) {
for (i = 0; i < RACE_MAXSKILLS; i++) RACE_SKILL_LEVELS[num][i] = str_to_num(value);
} else {
new arrIds[RACE_MAXSKILLS][3];
util_explodeString(arrIds, RACE_MAXSKILLS, 2, value, '|');
for (i = 0; i < RACE_MAXSKILLS; i++) RACE_SKILL_LEVELS[num][i] = str_to_num(arrIds[i]);
}
} else if (strfind(name, "skillnames") != -1) {
new arrIds[RACE_MAXSKILLS][20]; //Is fine????
util_explodeString(arrIds, RACE_MAXSKILLS, 19, value, '|');
for (i = 0; i < RACE_MAXSKILLS; i++) RACE_SKILL_NAMES[num][i] = arrIds[i];
} else if (strfind(name, "skilldesc") != -1) {
new arrIds[RACE_MAXSKILLS][50]; // LINE 79
util_explodeString(arrIds, RACE_MAXSKILLS, 49, value, '|');
for (i = 0; i < RACE_MAXSKILLS; i++) RACE_SKILL_INFO[num][i] = arrIds[i];
} else if (strfind(name, "skillreqlevel") != -1) {
new arrIds[RACE_MAXSKILLS][3]; //LINE 83
util_explodeString(arrIds, RACE_MAXSKILLS, 2, value, '|');
for (i = 0; i < RACE_MAXSKILLS; i++) RACE_SKILL_REQ_LEVEL[num][i] = str_to_num(arrIds[i]);
}
...