int stuff_int_list(int *ilp, int max_ints, int lookup_type)
{
int count = 0, ok_flag = 1, dummy;
ignore_white_space();
if (*Mp != '(') {
error_display(1, "Reading integer list. Found [%c]. Expecting '('.\n", *Mp);
longjmp(parse_abort, 6);
}
Mp++;
ignore_white_space();
while (*Mp != ')') {
Assert(count < max_ints);
if (*Mp == '"') {
int num = 0;
char str[128];
get_string(str);
switch (lookup_type) {
case SHIP_TYPE:
num = ship_name_lookup(str); // returns index of Ship[] entry with name
break;
case SHIP_INFO_TYPE:
ok_flag = 1;
num = ship_info_lookup(str); // returns index of Ship_info[] entry with name
if (num < 0)
ok_flag = 0;
break;
case WEAPON_POOL_TYPE:
ok_flag = 1;
num = weapon_info_lookup(str);
if (num < 0)
ok_flag = 0;
break;
case WEAPON_LIST_TYPE:
num = weapon_info_lookup(str);
if (num < 0)
num = -2;
break;
case RAW_INTEGER_TYPE:
num = atoi(str);
break;
default:
Error(LOCATION,"Unknown lookup_type in stuff_int_list");
break;
}
if (ok_flag) {
if (num == -1) {
Error(LOCATION, "Unable to find string \"%s\" in stuff_int_list\n\nMany possible sources for this error. Get a programmer!\n", str);
} else if (num == -2) {
if (strlen(str) > 0) {
Warning(LOCATION, "Unable to find WEAPON_LIST_TYPE string \"%s\" in stuff_int_list\n\nMany possible sources for this error. Get a programmer!\n", str);
}
}
if (num < 0) // other negatives used to bypass the above error trap, but should be -1
num = -1;
ilp[count++] = num;
}
} else {
if (ok_flag)
stuff_int(&ilp[count++]);
else
stuff_int(&dummy);
}
ignore_white_space();
}
Mp++;
return count;
}
Line 1420 reads
default:
Error(LOCATION,"Unknown lookup_type in stuff_int_list");
break;
Anyways, what were you doing at the time of the error?