Array support for addlogvar

git-svn-id: https://svn.eduke32.com/eduke32@678 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2008-04-01 03:32:36 +00:00
parent f90f48e439
commit eb8fde73b2

View file

@ -6334,6 +6334,24 @@ static int parse(void)
m = -1; m = -1;
lVarID ^= (MAXGAMEVARS<<1); lVarID ^= (MAXGAMEVARS<<1);
} }
else if (*insptr < MAXGAMEVARS+1+MAXGAMEARRAYS)
{
int index;
insptr++;
index=GetGameVarID(*insptr++,g_i,g_p);
if ((index < aGameArrays[lVarID-MAXGAMEVARS-1].size)&&(index>=0))
{
OSD_Printf("CONLOGVAR: L=%d %s[%d] =%d\n",l, aGameArrays[lVarID-MAXGAMEVARS-1].szLabel,index,aGameArrays[lVarID-MAXGAMEVARS-1].plValues[index]);
break;
}
else
{
OSD_Printf("CONLOGVAR: L=%d INVALID ARRAY INDEX\n",l);
break;
}
}
else else
{ {
// invalid varID // invalid varID
@ -6759,15 +6777,15 @@ static int parse(void)
insptr += 2; insptr += 2;
break; break;
case CON_SETARRAY: case CON_SETARRAY:
insptr++; insptr++;
j=*insptr++; j=*insptr++;
{ {
int index = GetGameVarID(*insptr++, g_i, g_p); int index = GetGameVarID(*insptr++, g_i, g_p);
int value = GetGameVarID(*insptr++, g_i, g_p); int value = GetGameVarID(*insptr++, g_i, g_p);
SetGameArrayID(j,index,value); SetGameArrayID(j,index,value);
break; break;
} }
case CON_RANDVAR: case CON_RANDVAR:
insptr++; insptr++;
@ -7284,12 +7302,12 @@ static int parse(void)
default: default:
OSD_Printf("fatal error: default processing: previous five values: %d, %d, %d, %d, %d, currrent opcode: %d, next five values: %d, %d, %d, %d, %d\ncurrent actor: %d (%d)\n",*(insptr-5),*(insptr-4),*(insptr-3),*(insptr-2),*(insptr-1),*insptr,*(insptr+1),*(insptr+2),*(insptr+3),*(insptr+4),*(insptr+5),g_i,g_sp->picnum); OSD_Printf("fatal error: default processing: previous five values: %d, %d, %d, %d, %d, currrent opcode: %d, next five values: %d, %d, %d, %d, %d\ncurrent actor: %d (%d)\n",*(insptr-5),*(insptr-4),*(insptr-3),*(insptr-2),*(insptr-1),*insptr,*(insptr+1),*(insptr+2),*(insptr+3),*(insptr+4),*(insptr+5),g_i,g_sp->picnum);
gameexit("An error has occurred in the EDuke32 CON executor.\n\n\ gameexit("An error has occurred in the EDuke32 CON executor.\n\n"
If you are an end user, please e-mail the file eduke32.log\n\ "If you are an end user, please e-mail the file eduke32.log\n"
along with links to any mods you're using to terminx@gmail.com.\n\n\ "along with links to any mods you're using to terminx@gmail.com.\n\n"
If you are a mod developer, please attach all of your CON files\n\ "If you are a mod developer, please attach all of your CON files\n"
along with instructions on how to reproduce this error.\n\n\ "along with instructions on how to reproduce this error.\n\n"
Thank you."); "Thank you!");
break; break;
} }
return 0; return 0;