git-svn-id: https://svn.eduke32.com/eduke32@970 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-08-11 23:33:53 +00:00
parent e97bb94719
commit 317cd92271

View file

@ -41,7 +41,7 @@ static intptr_t *g_t;
static spritetype *g_sp; static spritetype *g_sp;
static int killit_flag; static int killit_flag;
int line_num; int line_num;
int tw; int g_tw;
extern const char *keyw[]; extern const char *keyw[];
static int parse(void); static int parse(void);
@ -901,7 +901,7 @@ static void DoThisProjectile(int iSet, int lVar1, int lLabelID, int lVar2)
if (proj < 0 || proj >= MAXSPRITES) if (proj < 0 || proj >= MAXSPRITES)
{ {
// OSD_Printf("DoThisProjectile(): invalid projectile (%d)\n",proj); // OSD_Printf("DoThisProjectile(): invalid projectile (%d)\n",proj);
OSD_Printf(CON_ERROR "tried to %s %s on invalid target projectile (%d) %d %d from %s\n",line_num,keyw[tw], OSD_Printf(CON_ERROR "tried to %s %s on invalid target projectile (%d) %d %d from %s\n",line_num,keyw[g_tw],
iSet?"set":"get",projectilelabels[lLabelID].name,proj,g_i,g_sp->picnum, iSet?"set":"get",projectilelabels[lLabelID].name,proj,g_i,g_sp->picnum,
(lVar1<MAXGAMEVARS)?aGameVars[lVar1].szLabel:"extended"); (lVar1<MAXGAMEVARS)?aGameVars[lVar1].szLabel:"extended");
insptr += (lVar2 == MAXGAMEVARS); insptr += (lVar2 == MAXGAMEVARS);
@ -1181,7 +1181,7 @@ static void DoPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2)
if (iPlayer<0 || iPlayer >= ud.multimode) if (iPlayer<0 || iPlayer >= ud.multimode)
{ {
// OSD_Printf("DoPlayer(): invalid target player (%d) %d\n",iPlayer,g_i); // OSD_Printf("DoPlayer(): invalid target player (%d) %d\n",iPlayer,g_i);
OSD_Printf(CON_ERROR "tried to %s %s on invalid target player (%d) from spr %d gv %s\n",line_num,keyw[tw], OSD_Printf(CON_ERROR "tried to %s %s on invalid target player (%d) from spr %d gv %s\n",line_num,keyw[g_tw],
iSet?"set":"get",playerlabels[lLabelID].name,iPlayer,g_i, iSet?"set":"get",playerlabels[lLabelID].name,iPlayer,g_i,
(lVar1<MAXGAMEVARS)?aGameVars[lVar1].szLabel:"extended"); (lVar1<MAXGAMEVARS)?aGameVars[lVar1].szLabel:"extended");
insptr += (lVar2 == MAXGAMEVARS); insptr += (lVar2 == MAXGAMEVARS);
@ -1190,7 +1190,7 @@ static void DoPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2)
if (playerlabels[lLabelID].flags & LABEL_HASPARM2 && (lParm2 < 0 || lParm2 >= playerlabels[lLabelID].maxParm2)) if (playerlabels[lLabelID].flags & LABEL_HASPARM2 && (lParm2 < 0 || lParm2 >= playerlabels[lLabelID].maxParm2))
{ {
OSD_Printf(CON_ERROR "tried to %s invalid %s position %d on player (%d) from spr %d\n",line_num,keyw[tw], OSD_Printf(CON_ERROR "tried to %s invalid %s position %d on player (%d) from spr %d\n",line_num,keyw[g_tw],
iSet?"set":"get",playerlabels[lLabelID].name,lParm2,iPlayer,g_i); iSet?"set":"get",playerlabels[lLabelID].name,lParm2,iPlayer,g_i);
insptr += (lVar2 == MAXGAMEVARS); insptr += (lVar2 == MAXGAMEVARS);
return; return;
@ -2530,7 +2530,7 @@ static void DoInput(int iSet, int lVar1, int lLabelID, int lVar2)
if (iPlayer<0 || iPlayer >= ud.multimode) if (iPlayer<0 || iPlayer >= ud.multimode)
{ {
insptr += (lVar2 == MAXGAMEVARS); insptr += (lVar2 == MAXGAMEVARS);
OSD_Printf(CON_ERROR "invalid target player (%d) %d\n",line_num,keyw[tw],iPlayer,g_i); OSD_Printf(CON_ERROR "invalid target player (%d) %d\n",line_num,keyw[g_tw],iPlayer,g_i);
return; return;
} }
@ -2605,7 +2605,7 @@ static void DoWall(int iSet, int lVar1, int lLabelID, int lVar2)
if (iWall<0 || iWall >= numwalls) if (iWall<0 || iWall >= numwalls)
{ {
insptr += (lVar2 == MAXGAMEVARS); insptr += (lVar2 == MAXGAMEVARS);
OSD_Printf(CON_ERROR "Invalid wall %d\n",line_num,keyw[tw],iWall); OSD_Printf(CON_ERROR "Invalid wall %d\n",line_num,keyw[g_tw],iWall);
return; return;
} }
@ -2781,7 +2781,7 @@ static void DoSector(int iSet, int lVar1, int lLabelID, int lVar2)
if (iSector<0 || iSector >= numsectors) if (iSector<0 || iSector >= numsectors)
{ {
OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[tw],iSector); OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],iSector);
insptr += (lVar2 == MAXGAMEVARS); insptr += (lVar2 == MAXGAMEVARS);
return; return;
} }
@ -3013,7 +3013,7 @@ static void DoActor(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2)
if (iActor < 0 || iActor >= MAXSPRITES) if (iActor < 0 || iActor >= MAXSPRITES)
{ {
OSD_Printf(CON_ERROR "tried to %s %s on invalid target sprite (%d) from spr %d pic %d gv %s\n",line_num,keyw[tw], OSD_Printf(CON_ERROR "tried to %s %s on invalid target sprite (%d) from spr %d pic %d gv %s\n",line_num,keyw[g_tw],
iSet?"set":"get",actorlabels[lLabelID].name,iActor,g_i,g_sp->picnum, iSet?"set":"get",actorlabels[lLabelID].name,iActor,g_i,g_sp->picnum,
(lVar1<MAXGAMEVARS)?aGameVars[lVar1].szLabel:"extended"); (lVar1<MAXGAMEVARS)?aGameVars[lVar1].szLabel:"extended");
insptr += (lVar2 == MAXGAMEVARS); insptr += (lVar2 == MAXGAMEVARS);
@ -3022,7 +3022,7 @@ static void DoActor(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2)
if (actorlabels[lLabelID].flags & LABEL_HASPARM2 && (lParm2 < 0 || lParm2 >= actorlabels[lLabelID].maxParm2)) if (actorlabels[lLabelID].flags & LABEL_HASPARM2 && (lParm2 < 0 || lParm2 >= actorlabels[lLabelID].maxParm2))
{ {
OSD_Printf(CON_ERROR "tried to %s invalid %s position %d on sprite (%d) from spr %d\n",line_num,keyw[tw], OSD_Printf(CON_ERROR "tried to %s invalid %s position %d on sprite (%d) from spr %d\n",line_num,keyw[g_tw],
iSet?"set":"get",actorlabels[lLabelID].name,lParm2,iActor,g_i); iSet?"set":"get",actorlabels[lLabelID].name,lParm2,iActor,g_i);
insptr += (lVar2 == MAXGAMEVARS); insptr += (lVar2 == MAXGAMEVARS);
return; return;
@ -3507,7 +3507,7 @@ static void DoTsprite(int iSet, int lVar1, int lLabelID, int lVar2)
if (iActor < 0 || iActor >= MAXSPRITES) if (iActor < 0 || iActor >= MAXSPRITES)
{ {
OSD_Printf(CON_ERROR "invalid target sprite (%d) %d %d\n",line_num,keyw[tw],iActor,g_i,g_sp->picnum); OSD_Printf(CON_ERROR "invalid target sprite (%d) %d %d\n",line_num,keyw[g_tw],iActor,g_i,g_sp->picnum);
insptr += (lVar2 == MAXGAMEVARS); insptr += (lVar2 == MAXGAMEVARS);
return; return;
} }
@ -3648,7 +3648,7 @@ static void DoProjectile(int iSet, int lVar1, int lLabelID, int lVar2)
if (lVar1 < 0 || lVar1 >= MAXTILES) if (lVar1 < 0 || lVar1 >= MAXTILES)
{ {
OSD_Printf(CON_ERROR "invalid tile (%d)\n",line_num,keyw[tw],lVar1); OSD_Printf(CON_ERROR "invalid tile (%d)\n",line_num,keyw[g_tw],lVar1);
insptr += (lVar2 == MAXGAMEVARS); insptr += (lVar2 == MAXGAMEVARS);
return; return;
} }
@ -3919,7 +3919,7 @@ void OnEvent(int iEventID, int iActor, int iPlayer, int lDist)
{ {
if (iEventID<0 || iEventID >= MAXGAMEEVENTS) if (iEventID<0 || iEventID >= MAXGAMEEVENTS)
{ {
OSD_Printf(CON_ERROR "invalid event ID",line_num,keyw[tw]); OSD_Printf(CON_ERROR "invalid event ID",line_num,keyw[g_tw]);
return; return;
} }
@ -4496,7 +4496,7 @@ static inline void parseifelse(int condition)
static int parse(void) static int parse(void)
{ {
int j, l, s; int j, l, s, tw = *insptr;
if (killit_flag) return 1; if (killit_flag) return 1;
@ -4504,8 +4504,8 @@ static int parse(void)
// Bsprintf(g_szBuf,"Parsing: %d",*insptr); // Bsprintf(g_szBuf,"Parsing: %d",*insptr);
// AddLog(g_szBuf); // AddLog(g_szBuf);
line_num = (*insptr)>>12; line_num = tw>>12;
tw = (*insptr)&0xFFF; g_tw = tw &= 0xFFF;
switch (tw) switch (tw)
{ {
@ -4515,7 +4515,7 @@ static int parse(void)
int q = *insptr++, i = *insptr++; int q = *insptr++, i = *insptr++;
if (fta_quotes[q] == NULL || redefined_quotes[i] == NULL) if (fta_quotes[q] == NULL || redefined_quotes[i] == NULL)
{ {
OSD_Printf(CON_ERROR "%s %d null quote\n",line_num,keyw[tw],q,i); OSD_Printf(CON_ERROR "%s %d null quote\n",line_num,keyw[g_tw],q,i);
break; break;
} }
Bstrcpy(fta_quotes[q],redefined_quotes[i]); Bstrcpy(fta_quotes[q],redefined_quotes[i]);
@ -4773,7 +4773,7 @@ static int parse(void)
insptr++; insptr++;
if (g_sp->yvel<0 || g_sp->yvel>=MAXSOUNDS) if (g_sp->yvel<0 || g_sp->yvel>=MAXSOUNDS)
{ {
OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[tw],g_sp->yvel); OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[g_tw],g_sp->yvel);
insptr++; insptr++;
break; break;
} }
@ -4821,7 +4821,7 @@ static int parse(void)
case CON_SOUNDONCE: case CON_SOUNDONCE:
insptr++; insptr++;
if (*insptr<0 || *insptr>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[tw],*insptr);insptr++;break;} if (*insptr<0 || *insptr>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[g_tw],*insptr);insptr++;break;}
if (!isspritemakingsound(g_i,*insptr)) if (!isspritemakingsound(g_i,*insptr))
spritesound((short) *insptr,g_i); spritesound((short) *insptr,g_i);
insptr++; insptr++;
@ -4829,14 +4829,14 @@ static int parse(void)
case CON_IFSOUND: case CON_IFSOUND:
insptr++; insptr++;
if (*insptr<0 || *insptr>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[tw],*insptr);insptr++;break;} if (*insptr<0 || *insptr>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[g_tw],*insptr);insptr++;break;}
parseifelse(isspritemakingsound(g_i,*insptr)); parseifelse(isspritemakingsound(g_i,*insptr));
// parseifelse(SoundOwner[*insptr][0].i == g_i); // parseifelse(SoundOwner[*insptr][0].i == g_i);
break; break;
case CON_STOPSOUND: case CON_STOPSOUND:
insptr++; insptr++;
if (*insptr<0 || *insptr>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[tw],*insptr);insptr++;break;} if (*insptr<0 || *insptr>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[g_tw],*insptr);insptr++;break;}
if (isspritemakingsound(g_i,*insptr)) if (isspritemakingsound(g_i,*insptr))
stopspritesound((short)*insptr,g_i); stopspritesound((short)*insptr,g_i);
insptr++; insptr++;
@ -4844,7 +4844,7 @@ static int parse(void)
case CON_GLOBALSOUND: case CON_GLOBALSOUND:
insptr++; insptr++;
if (*insptr<0 || *insptr>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[tw],*insptr);insptr++;break;} if (*insptr<0 || *insptr>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[g_tw],*insptr);insptr++;break;}
if (g_p == screenpeek || (gametype_flags[ud.coop]&GAMETYPE_FLAG_COOPSOUND)) if (g_p == screenpeek || (gametype_flags[ud.coop]&GAMETYPE_FLAG_COOPSOUND))
spritesound((short) *insptr,g_player[screenpeek].ps->i); spritesound((short) *insptr,g_player[screenpeek].ps->i);
insptr++; insptr++;
@ -4852,7 +4852,7 @@ static int parse(void)
case CON_SOUND: case CON_SOUND:
insptr++; insptr++;
if (*insptr<0 || *insptr>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[tw],*insptr);insptr++;break;} if (*insptr<0 || *insptr>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[g_tw],*insptr);insptr++;break;}
spritesound((short) *insptr++,g_i); spritesound((short) *insptr++,g_i);
break; break;
@ -4955,7 +4955,7 @@ static int parse(void)
return 1; return 1;
case CON_ADDAMMO: case CON_ADDAMMO:
insptr++; insptr++;
if (*insptr<0 || *insptr>=MAX_WEAPONS) {OSD_Printf(CON_ERROR "Invalid weapon ID %d\n",line_num,keyw[tw],*insptr);insptr+=2;break;} if (*insptr<0 || *insptr>=MAX_WEAPONS) {OSD_Printf(CON_ERROR "Invalid weapon ID %d\n",line_num,keyw[g_tw],*insptr);insptr+=2;break;}
if (g_player[g_p].ps->ammo_amount[*insptr] >= g_player[g_p].ps->max_ammo_amount[*insptr]) if (g_player[g_p].ps->ammo_amount[*insptr] >= g_player[g_p].ps->max_ammo_amount[*insptr])
{ {
killit_flag = 2; killit_flag = 2;
@ -5009,7 +5009,7 @@ static int parse(void)
case CON_ADDWEAPON: case CON_ADDWEAPON:
insptr++; insptr++;
if (*insptr<0 ||*insptr>=MAX_WEAPONS) {OSD_Printf(CON_ERROR "Invalid weapon ID %d\n",line_num,keyw[tw],*insptr);insptr+=2;break;} if (*insptr<0 ||*insptr>=MAX_WEAPONS) {OSD_Printf(CON_ERROR "Invalid weapon ID %d\n",line_num,keyw[g_tw],*insptr);insptr+=2;break;}
if (g_player[g_p].ps->gotweapon[*insptr] == 0) if (g_player[g_p].ps->gotweapon[*insptr] == 0)
{ {
if (!(g_player[g_p].ps->weaponswitch & 1)) addweaponnoswitch(g_player[g_p].ps, *insptr); if (!(g_player[g_p].ps->weaponswitch & 1)) addweaponnoswitch(g_player[g_p].ps, *insptr);
@ -5172,22 +5172,22 @@ static int parse(void)
switch (tw) switch (tw)
{ {
case CON_ACTIVATEBYSECTOR: case CON_ACTIVATEBYSECTOR:
if (var1<0 || var1>=numsectors) {OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[tw],var1);break;} if (var1<0 || var1>=numsectors) {OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],var1);break;}
activatebysector(var1, var2); activatebysector(var1, var2);
break; break;
case CON_OPERATESECTORS: case CON_OPERATESECTORS:
if (var1<0 || var1>=numsectors) {OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[tw],var1);break;} if (var1<0 || var1>=numsectors) {OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],var1);break;}
operatesectors(var1, var2); operatesectors(var1, var2);
break; break;
case CON_OPERATEACTIVATORS: case CON_OPERATEACTIVATORS:
if (var2<0 || var2>=ud.multimode) {OSD_Printf(CON_ERROR "Invalid player %d\n",line_num,keyw[tw],var2);break;} if (var2<0 || var2>=ud.multimode) {OSD_Printf(CON_ERROR "Invalid player %d\n",line_num,keyw[g_tw],var2);break;}
operateactivators(var1, var2); operateactivators(var1, var2);
break; break;
case CON_SETASPECT: case CON_SETASPECT:
setaspect(var1, var2); setaspect(var1, var2);
break; break;
case CON_SSP: case CON_SSP:
if (var1<0 || var1>=MAXSPRITES) { OSD_Printf(CON_ERROR "Invalid sprite %d\n",line_num,keyw[tw],var1);break;} if (var1<0 || var1>=MAXSPRITES) { OSD_Printf(CON_ERROR "Invalid sprite %d\n",line_num,keyw[g_tw],var1);break;}
ssp(var1, var2); ssp(var1, var2);
break; break;
} }
@ -5201,7 +5201,7 @@ static int parse(void)
if (lVar1<0 || lVar1>=MAXSPRITES || lVar2<0 || lVar2>=MAXSPRITES) if (lVar1<0 || lVar1>=MAXSPRITES || lVar2<0 || lVar2>=MAXSPRITES)
{ {
OSD_Printf(CON_ERROR "Invalid sprite %d\n",line_num,keyw[tw],lVar1<0||lVar1>=MAXSPRITES?lVar1:lVar2); OSD_Printf(CON_ERROR "Invalid sprite %d\n",line_num,keyw[g_tw],lVar1<0||lVar1>=MAXSPRITES?lVar1:lVar2);
res=0; res=0;
} }
else res=cansee(sprite[lVar1].x,sprite[lVar1].y,sprite[lVar1].z,sprite[lVar1].sectnum, else res=cansee(sprite[lVar1].x,sprite[lVar1].y,sprite[lVar1].z,sprite[lVar1].sectnum,
@ -5245,7 +5245,7 @@ static int parse(void)
j=GetGameVarID(*insptr++, g_i, g_p); j=GetGameVarID(*insptr++, g_i, g_p);
if (fta_quotes[j] == NULL) if (fta_quotes[j] == NULL)
{ {
OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[tw],j); OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[g_tw],j);
SetGameVarID(i,-1,g_i,g_p); SetGameVarID(i,-1,g_i,g_p);
break; break;
} }
@ -5268,7 +5268,7 @@ static int parse(void)
case CON_HEADSPRITESTAT: case CON_HEADSPRITESTAT:
if (j < 0 || j > MAXSTATUS) if (j < 0 || j > MAXSTATUS)
{ {
OSD_Printf(CON_ERROR "invalid status list %d\n",line_num,keyw[tw],j); OSD_Printf(CON_ERROR "invalid status list %d\n",line_num,keyw[g_tw],j);
break; break;
} }
SetGameVarID(i,headspritestat[j],g_i,g_p); SetGameVarID(i,headspritestat[j],g_i,g_p);
@ -5276,7 +5276,7 @@ static int parse(void)
case CON_PREVSPRITESTAT: case CON_PREVSPRITESTAT:
if (j < 0 || j >= MAXSPRITES) if (j < 0 || j >= MAXSPRITES)
{ {
OSD_Printf(CON_ERROR "invalid sprite ID %d\n",line_num,keyw[tw],j); OSD_Printf(CON_ERROR "invalid sprite ID %d\n",line_num,keyw[g_tw],j);
break; break;
} }
SetGameVarID(i,prevspritestat[j],g_i,g_p); SetGameVarID(i,prevspritestat[j],g_i,g_p);
@ -5284,7 +5284,7 @@ static int parse(void)
case CON_NEXTSPRITESTAT: case CON_NEXTSPRITESTAT:
if (j < 0 || j >= MAXSPRITES) if (j < 0 || j >= MAXSPRITES)
{ {
OSD_Printf(CON_ERROR "invalid sprite ID %d\n",line_num,keyw[tw],j); OSD_Printf(CON_ERROR "invalid sprite ID %d\n",line_num,keyw[g_tw],j);
break; break;
} }
SetGameVarID(i,nextspritestat[j],g_i,g_p); SetGameVarID(i,nextspritestat[j],g_i,g_p);
@ -5292,7 +5292,7 @@ static int parse(void)
case CON_HEADSPRITESECT: case CON_HEADSPRITESECT:
if (j < 0 || j > numsectors) if (j < 0 || j > numsectors)
{ {
OSD_Printf(CON_ERROR "invalid sector %d\n",line_num,keyw[tw],j); OSD_Printf(CON_ERROR "invalid sector %d\n",line_num,keyw[g_tw],j);
break; break;
} }
SetGameVarID(i,headspritesect[j],g_i,g_p); SetGameVarID(i,headspritesect[j],g_i,g_p);
@ -5300,7 +5300,7 @@ static int parse(void)
case CON_PREVSPRITESECT: case CON_PREVSPRITESECT:
if (j < 0 || j >= MAXSPRITES) if (j < 0 || j >= MAXSPRITES)
{ {
OSD_Printf(CON_ERROR "invalid sprite ID %d\n",line_num,keyw[tw],j); OSD_Printf(CON_ERROR "invalid sprite ID %d\n",line_num,keyw[g_tw],j);
break; break;
} }
SetGameVarID(i,prevspritesect[j],g_i,g_p); SetGameVarID(i,prevspritesect[j],g_i,g_p);
@ -5308,7 +5308,7 @@ static int parse(void)
case CON_NEXTSPRITESECT: case CON_NEXTSPRITESECT:
if (j < 0 || j >= MAXSPRITES) if (j < 0 || j >= MAXSPRITES)
{ {
OSD_Printf(CON_ERROR "invalid sprite ID %d\n",line_num,keyw[tw],j); OSD_Printf(CON_ERROR "invalid sprite ID %d\n",line_num,keyw[g_tw],j);
break; break;
} }
SetGameVarID(i,nextspritesect[j],g_i,g_p); SetGameVarID(i,nextspritesect[j],g_i,g_p);
@ -5323,9 +5323,9 @@ static int parse(void)
int i = GetGameVarID(*insptr++, g_i, g_p), int i = GetGameVarID(*insptr++, g_i, g_p),
f=GetGameVarID(*insptr++, g_i, g_p); f=GetGameVarID(*insptr++, g_i, g_p);
j=GetGameVarID(*insptr++, g_i, g_p); j=GetGameVarID(*insptr++, g_i, g_p);
if (i<0 || i>=MAXQUOTES) OSD_Printf(CON_ERROR "invalid quote ID %d\n",line_num,keyw[tw],i); if (i<0 || i>=MAXQUOTES) OSD_Printf(CON_ERROR "invalid quote ID %d\n",line_num,keyw[g_tw],i);
else if (fta_quotes[i] == NULL) OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[tw],i); else if (fta_quotes[i] == NULL) OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[g_tw],i);
else if (f<0 || f>=NUMGAMEFUNCTIONS) OSD_Printf(CON_ERROR "invalid function %d\n",line_num,keyw[tw],f); else if (f<0 || f>=NUMGAMEFUNCTIONS) OSD_Printf(CON_ERROR "invalid function %d\n",line_num,keyw[g_tw],f);
else else
{ {
if (j<2) if (j<2)
@ -5353,10 +5353,10 @@ static int parse(void)
st = GetGameVarID(*insptr++, g_i, g_p); st = GetGameVarID(*insptr++, g_i, g_p);
ln = GetGameVarID(*insptr++, g_i, g_p); ln = GetGameVarID(*insptr++, g_i, g_p);
if (q1<0 || q1>=MAXQUOTES) OSD_Printf(CON_ERROR "invalid quote ID %d\n",line_num,keyw[tw],q1); if (q1<0 || q1>=MAXQUOTES) OSD_Printf(CON_ERROR "invalid quote ID %d\n",line_num,keyw[g_tw],q1);
else if (fta_quotes[q1] == NULL) OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[tw],q1); else if (fta_quotes[q1] == NULL) OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[g_tw],q1);
else if (q2<0 || q2>=MAXQUOTES) OSD_Printf(CON_ERROR "invalid quote ID %d\n",line_num,keyw[tw],q2); else if (q2<0 || q2>=MAXQUOTES) OSD_Printf(CON_ERROR "invalid quote ID %d\n",line_num,keyw[g_tw],q2);
else if (fta_quotes[q2] == NULL) OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[tw],q2); else if (fta_quotes[q2] == NULL) OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[g_tw],q2);
else else
{ {
s1=fta_quotes[q1]; s1=fta_quotes[q1];
@ -5389,7 +5389,7 @@ static int parse(void)
case CON_GETPNAME: case CON_GETPNAME:
if (fta_quotes[i] == NULL) if (fta_quotes[i] == NULL)
{ {
OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[tw],i); OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[g_tw],i);
break; break;
} }
if (g_player[j].user_name[0]) if (g_player[j].user_name[0])
@ -5399,7 +5399,7 @@ static int parse(void)
case CON_QGETSYSSTR: case CON_QGETSYSSTR:
if (fta_quotes[i] == NULL) if (fta_quotes[i] == NULL)
{ {
OSD_Printf(CON_ERROR "null quote %d %d\n",line_num,keyw[tw],i,j); OSD_Printf(CON_ERROR "null quote %d %d\n",line_num,keyw[g_tw],i,j);
break; break;
} }
switch (j) switch (j)
@ -5420,13 +5420,13 @@ static int parse(void)
Bstrcpy(fta_quotes[i],gametype_names[ud.coop]); Bstrcpy(fta_quotes[i],gametype_names[ud.coop]);
break; break;
default: default:
OSD_Printf(CON_ERROR "unknown str ID %d %d\n",line_num,keyw[tw],i,j); OSD_Printf(CON_ERROR "unknown str ID %d %d\n",line_num,keyw[g_tw],i,j);
} }
break; break;
case CON_QSTRCAT: case CON_QSTRCAT:
if (fta_quotes[i] == NULL || fta_quotes[j] == NULL) if (fta_quotes[i] == NULL || fta_quotes[j] == NULL)
{ {
OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[tw],fta_quotes[i] ? j : i); OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[g_tw],fta_quotes[i] ? j : i);
break; break;
} }
Bstrncat(fta_quotes[i],fta_quotes[j],(MAXQUOTELEN-1)-Bstrlen(fta_quotes[i])); Bstrncat(fta_quotes[i],fta_quotes[j],(MAXQUOTELEN-1)-Bstrlen(fta_quotes[i]));
@ -5434,19 +5434,19 @@ static int parse(void)
case CON_QSTRCPY: case CON_QSTRCPY:
if (fta_quotes[i] == NULL || fta_quotes[j] == NULL) if (fta_quotes[i] == NULL || fta_quotes[j] == NULL)
{ {
OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[tw],fta_quotes[i] ? j : i); OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[g_tw],fta_quotes[i] ? j : i);
break; break;
} }
Bstrcpy(fta_quotes[i],fta_quotes[j]); Bstrcpy(fta_quotes[i],fta_quotes[j]);
break; break;
case CON_CHANGESPRITESTAT: case CON_CHANGESPRITESTAT:
if (i<0 || i>=MAXSPRITES) {OSD_Printf(CON_ERROR "Invalid sprite %d\n",line_num,keyw[tw],i);break;} if (i<0 || i>=MAXSPRITES) {OSD_Printf(CON_ERROR "Invalid sprite %d\n",line_num,keyw[g_tw],i);break;}
if (j<0 || j>=MAXSTATUS) {OSD_Printf(CON_ERROR "Invalid status %d\n",line_num,keyw[tw],j);break;} if (j<0 || j>=MAXSTATUS) {OSD_Printf(CON_ERROR "Invalid status %d\n",line_num,keyw[g_tw],j);break;}
changespritestat(i,j); changespritestat(i,j);
break; break;
case CON_CHANGESPRITESECT: case CON_CHANGESPRITESECT:
if (i<0 || i>=MAXSPRITES) {OSD_Printf(CON_ERROR "Invalid sprite %d\n",line_num,keyw[tw],i);break;} if (i<0 || i>=MAXSPRITES) {OSD_Printf(CON_ERROR "Invalid sprite %d\n",line_num,keyw[g_tw],i);break;}
if (j<0 || j>=numsectors) {OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[tw],j);break;} if (j<0 || j>=numsectors) {OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],j);break;}
changespritesect(i,j); changespritesect(i,j);
break; break;
} }
@ -5461,13 +5461,13 @@ static int parse(void)
if (volnume > MAXVOLUMES-1 || volnume < 0) if (volnume > MAXVOLUMES-1 || volnume < 0)
{ {
OSD_Printf(CON_ERROR "invalid volume (%d)\n",line_num,keyw[tw],volnume); OSD_Printf(CON_ERROR "invalid volume (%d)\n",line_num,keyw[g_tw],volnume);
break; break;
} }
if (levnume > MAXLEVELS-1 || levnume < 0) if (levnume > MAXLEVELS-1 || levnume < 0)
{ {
OSD_Printf(CON_ERROR "invalid level (%d)\n",line_num,keyw[tw],levnume); OSD_Printf(CON_ERROR "invalid level (%d)\n",line_num,keyw[g_tw],levnume);
break; break;
} }
@ -5604,7 +5604,7 @@ static int parse(void)
{ {
int wallnum = GetGameVarID(*insptr++, g_i, g_p), newx = GetGameVarID(*insptr++, g_i, g_p), newy = GetGameVarID(*insptr++, g_i, g_p); int wallnum = GetGameVarID(*insptr++, g_i, g_p), newx = GetGameVarID(*insptr++, g_i, g_p), newy = GetGameVarID(*insptr++, g_i, g_p);
if (wallnum<0 || wallnum>=numwalls) {OSD_Printf(CON_ERROR "Invalid wall %d\n",line_num,keyw[tw],wallnum);break;} if (wallnum<0 || wallnum>=numwalls) {OSD_Printf(CON_ERROR "Invalid wall %d\n",line_num,keyw[g_tw],wallnum);break;}
dragpoint(wallnum,newx,newy); dragpoint(wallnum,newx,newy);
break; break;
} }
@ -5617,7 +5617,7 @@ static int parse(void)
if (xvar < 0 || yvar < 0 || xvar >= MAXSPRITES || yvar >= MAXSPRITES) if (xvar < 0 || yvar < 0 || xvar >= MAXSPRITES || yvar >= MAXSPRITES)
{ {
OSD_Printf(CON_ERROR "invalid sprite\n",line_num,keyw[tw]); OSD_Printf(CON_ERROR "invalid sprite\n",line_num,keyw[g_tw]);
break; break;
} }
if (tw == CON_DIST) distx = dist(&sprite[xvar],&sprite[yvar]); if (tw == CON_DIST) distx = dist(&sprite[xvar],&sprite[yvar]);
@ -5676,7 +5676,7 @@ static int parse(void)
int lIn=GetGameVarID(*insptr++, g_i, g_p); int lIn=GetGameVarID(*insptr++, g_i, g_p);
if (g_sp->sectnum < 0 || g_sp->sectnum >= numsectors) if (g_sp->sectnum < 0 || g_sp->sectnum >= numsectors)
{ {
OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[tw],g_sp->sectnum); OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],g_sp->sectnum);
break; break;
} }
j = spawn(g_i, lIn); j = spawn(g_i, lIn);
@ -5703,7 +5703,7 @@ static int parse(void)
if (g_sp->sectnum < 0 || g_sp->sectnum >= numsectors) if (g_sp->sectnum < 0 || g_sp->sectnum >= numsectors)
{ {
OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[tw],g_sp->sectnum); OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],g_sp->sectnum);
insptr++; insptr++;
break; break;
} }
@ -5739,7 +5739,7 @@ static int parse(void)
if (g_sp->sectnum < 0 || g_sp->sectnum >= numsectors) if (g_sp->sectnum < 0 || g_sp->sectnum >= numsectors)
{ {
OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[tw],g_sp->sectnum); OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],g_sp->sectnum);
insptr++; insptr++;
hittype[g_i].temp_data[9]=0; hittype[g_i].temp_data[9]=0;
break; break;
@ -5772,7 +5772,7 @@ static int parse(void)
if (g_sp->sectnum < 0 || g_sp->sectnum >= numsectors) if (g_sp->sectnum < 0 || g_sp->sectnum >= numsectors)
{ {
OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[tw],g_sp->sectnum); OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],g_sp->sectnum);
hittype[g_i].temp_data[9]=0; hittype[g_i].temp_data[9]=0;
break; break;
} }
@ -5800,21 +5800,21 @@ static int parse(void)
switch (tw) switch (tw)
{ {
case CON_SOUNDONCEVAR: case CON_SOUNDONCEVAR:
if (j<0 || j>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[tw],j);break;} if (j<0 || j>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[g_tw],j);break;}
if (!isspritemakingsound(g_i,j)) if (!isspritemakingsound(g_i,j))
spritesound((short)j,g_i); spritesound((short)j,g_i);
break; break;
case CON_GLOBALSOUNDVAR: case CON_GLOBALSOUNDVAR:
if (j<0 || j>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[tw],j);break;} if (j<0 || j>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[g_tw],j);break;}
spritesound((short)j,g_player[screenpeek].ps->i); spritesound((short)j,g_player[screenpeek].ps->i);
break; break;
case CON_STOPSOUNDVAR: case CON_STOPSOUNDVAR:
if (j<0 || j>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[tw],j);break;} if (j<0 || j>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[g_tw],j);break;}
if (isspritemakingsound(g_i,j)) if (isspritemakingsound(g_i,j))
stopspritesound((short)j,g_i); stopspritesound((short)j,g_i);
break; break;
case CON_SOUNDVAR: case CON_SOUNDVAR:
if (j<0 || j>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[tw],j);break;} if (j<0 || j>=MAXSOUNDS) {OSD_Printf(CON_ERROR "Invalid sound %d\n",line_num,keyw[g_tw],j);break;}
spritesound((short)j,g_i); spritesound((short)j,g_i);
break; break;
} }
@ -5827,7 +5827,7 @@ static int parse(void)
if (j >= 0 && j < MAXUNIQHUDID-1) if (j >= 0 && j < MAXUNIQHUDID-1)
guniqhudid = j; guniqhudid = j;
else else
OSD_Printf(CON_ERROR "Invalid ID %d\n",line_num,keyw[tw],j); OSD_Printf(CON_ERROR "Invalid ID %d\n",line_num,keyw[g_tw],j);
break; break;
} }
@ -5875,12 +5875,12 @@ static int parse(void)
if (x1 < 0 || y1 < 0 || x2 > xdim-1 || y2 > ydim-1 || x2-x1 < 2 || y2-y1 < 2) if (x1 < 0 || y1 < 0 || x2 > xdim-1 || y2 > ydim-1 || x2-x1 < 2 || y2-y1 < 2)
{ {
OSD_Printf(CON_ERROR "incorrect coordinates\n",line_num,keyw[tw]); OSD_Printf(CON_ERROR "incorrect coordinates\n",line_num,keyw[g_tw]);
break; break;
} }
if (sect<0 || sect>=numsectors) if (sect<0 || sect>=numsectors)
{ {
OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[tw],sect); OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],sect);
break; break;
} }
@ -5994,7 +5994,7 @@ static int parse(void)
int z=65536; int z=65536;
if (fta_quotes[q] == NULL) if (fta_quotes[q] == NULL)
{ {
OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[tw],q); OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[g_tw],q);
break; break;
} }
if (tw == CON_GAMETEXTZ)z=GetGameVarID(*insptr++,g_i,g_p); if (tw == CON_GAMETEXTZ)z=GetGameVarID(*insptr++,g_i,g_p);
@ -6008,7 +6008,7 @@ static int parse(void)
if (fta_quotes[q] == NULL) if (fta_quotes[q] == NULL)
{ {
OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[tw],q); OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[g_tw],q);
break; break;
} }
minitextshade(x,y,fta_quotes[q],shade,pal,26); minitextshade(x,y,fta_quotes[q],shade,pal,26);
@ -6031,7 +6031,7 @@ static int parse(void)
if (sectnum<0 || sectnum>=numsectors) if (sectnum<0 || sectnum>=numsectors)
{ {
OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[tw],sectnum); OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],sectnum);
break; break;
} }
getzrange(x, y, z, sectnum, &ceilz, &ceilhit, &florz, &florhit, walldist, clipmask); getzrange(x, y, z, sectnum, &ceilz, &ceilhit, &florz, &florhit, walldist, clipmask);
@ -6055,7 +6055,7 @@ static int parse(void)
if (sectnum<0 || sectnum>=numsectors) if (sectnum<0 || sectnum>=numsectors)
{ {
OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[tw],sectnum); OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],sectnum);
break; break;
} }
hitscan(xs, ys, zs, sectnum, vx, vy, vz, &hitsect, &hitwall, &hitsprite, &hitx, &hity, &hitz, cliptype); hitscan(xs, ys, zs, sectnum, vx, vy, vz, &hitsect, &hitwall, &hitsprite, &hitx, &hity, &hitz, cliptype);
@ -6078,7 +6078,7 @@ static int parse(void)
if (sect1<0 || sect1>=numsectors || sect2<0 || sect2>=numsectors) if (sect1<0 || sect1>=numsectors || sect2<0 || sect2>=numsectors)
{ {
OSD_Printf(CON_ERROR "Invalid sector\n",line_num,keyw[tw]); OSD_Printf(CON_ERROR "Invalid sector\n",line_num,keyw[g_tw]);
SetGameVarID(rvar, 0, g_i, g_p); SetGameVarID(rvar, 0, g_i, g_p);
} }
@ -6118,7 +6118,7 @@ static int parse(void)
if (sectnum<0 || sectnum>=numsectors) if (sectnum<0 || sectnum>=numsectors)
{ {
OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[tw],sectnum); OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],sectnum);
break; break;
} }
neartag(x, y, z, sectnum, ang, &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, neartagrange, tagsearch); neartag(x, y, z, sectnum, ang, &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, neartagrange, tagsearch);
@ -6163,7 +6163,7 @@ static int parse(void)
{ {
if (spritenum < 0 || spritenum >= MAXSPRITES) if (spritenum < 0 || spritenum >= MAXSPRITES)
{ {
OSD_Printf(CON_ERROR "invalid sprite ID %d\n",line_num,keyw[tw],spritenum); OSD_Printf(CON_ERROR "invalid sprite ID %d\n",line_num,keyw[g_tw],spritenum);
break; break;
} }
setsprite(spritenum, x, y, z); setsprite(spritenum, x, y, z);
@ -6175,7 +6175,7 @@ static int parse(void)
if (spritenum < 0 && spritenum >= MAXSPRITES) if (spritenum < 0 && spritenum >= MAXSPRITES)
{ {
OSD_Printf(CON_ERROR "invalid sprite ID %d\n",line_num,keyw[tw],spritenum); OSD_Printf(CON_ERROR "invalid sprite ID %d\n",line_num,keyw[g_tw],spritenum);
insptr++; insptr++;
break; break;
} }
@ -6191,7 +6191,7 @@ static int parse(void)
int sectnum = GetGameVarID(*insptr++,g_i,g_p), x = GetGameVarID(*insptr++,g_i,g_p), y = GetGameVarID(*insptr++,g_i,g_p); int sectnum = GetGameVarID(*insptr++,g_i,g_p), x = GetGameVarID(*insptr++,g_i,g_p), y = GetGameVarID(*insptr++,g_i,g_p);
if (sectnum<0 || sectnum>=numsectors) if (sectnum<0 || sectnum>=numsectors)
{ {
OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[tw],sectnum); OSD_Printf(CON_ERROR "Invalid sector %d\n",line_num,keyw[g_tw],sectnum);
insptr++; insptr++;
break; break;
} }
@ -6506,7 +6506,7 @@ static int parse(void)
g_player[g_p].ps->boot_amount = *insptr; g_player[g_p].ps->boot_amount = *insptr;
break; break;
default: default:
OSD_Printf(CON_ERROR "Invalid inventory ID %d\n",line_num,keyw[tw],*(insptr-1)); OSD_Printf(CON_ERROR "Invalid inventory ID %d\n",line_num,keyw[g_tw],*(insptr-1));
break; break;
} }
insptr++; insptr++;
@ -6630,7 +6630,7 @@ static int parse(void)
j = GetGameVarID(*insptr++,g_i,g_p); j = GetGameVarID(*insptr++,g_i,g_p);
if (j < 0 || j >= MAXVOLUMES*MAXLEVELS) if (j < 0 || j >= MAXVOLUMES*MAXLEVELS)
{ {
OSD_Printf(CON_ERROR "Invalid map number: %d\n",line_num,keyw[tw],j); OSD_Printf(CON_ERROR "Invalid map number: %d\n",line_num,keyw[g_tw],j);
return 0; return 0;
} }
if (map[j].savedstate) if (map[j].savedstate)
@ -6735,7 +6735,7 @@ static int parse(void)
int dq = *insptr++, sq = *insptr++; int dq = *insptr++, sq = *insptr++;
if (fta_quotes[sq] == NULL || fta_quotes[dq] == NULL) if (fta_quotes[sq] == NULL || fta_quotes[dq] == NULL)
{ {
OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[tw],fta_quotes[sq] ? dq : sq); OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[g_tw],fta_quotes[sq] ? dq : sq);
insptr += 4; insptr += 4;
break; break;
} }
@ -6785,13 +6785,13 @@ static int parse(void)
index=GetGameVarID(*insptr++,g_i,g_p); index=GetGameVarID(*insptr++,g_i,g_p);
if ((index < aGameArrays[lVarID].size)&&(index>=0)) if ((index < aGameArrays[lVarID].size)&&(index>=0))
{ {
OSD_Printf(OSDTEXT_GREEN "%s: L=%d %s[%d] =%d\n",line_num,keyw[tw], OSD_Printf(OSDTEXT_GREEN "%s: L=%d %s[%d] =%d\n",line_num,keyw[g_tw],
aGameArrays[lVarID].szLabel,index,m*aGameArrays[lVarID].plValues[index]); aGameArrays[lVarID].szLabel,index,m*aGameArrays[lVarID].plValues[index]);
break; break;
} }
else else
{ {
OSD_Printf(CON_ERROR "invalid array index\n",line_num,keyw[tw]); OSD_Printf(CON_ERROR "invalid array index\n",line_num,keyw[g_tw]);
break; break;
} }
} }
@ -6804,7 +6804,7 @@ static int parse(void)
{ {
// invalid varID // invalid varID
insptr++; insptr++;
OSD_Printf(CON_ERROR "invalid variable\n",line_num,keyw[tw]); OSD_Printf(CON_ERROR "invalid variable\n",line_num,keyw[g_tw]);
break; // out of switch break; // out of switch
} }
} }
@ -7116,7 +7116,7 @@ static int parse(void)
if (lSprite < 0 || lSprite >= MAXSPRITES) if (lSprite < 0 || lSprite >= MAXSPRITES)
{ {
OSD_Printf(CON_ERROR "invalid sprite ID %d\n",line_num,keyw[tw],lSprite); OSD_Printf(CON_ERROR "invalid sprite ID %d\n",line_num,keyw[g_tw],lSprite);
break; break;
} }
@ -7145,7 +7145,7 @@ static int parse(void)
if (iPlayer < 0 || iPlayer >= ud.multimode) if (iPlayer < 0 || iPlayer >= ud.multimode)
{ {
OSD_Printf(CON_ERROR "invalid player ID %d\n",line_num,keyw[tw],iPlayer); OSD_Printf(CON_ERROR "invalid player ID %d\n",line_num,keyw[g_tw],iPlayer);
break; break;
} }
@ -7217,7 +7217,7 @@ static int parse(void)
if (j < 0 || j >= ud.multimode) if (j < 0 || j >= ud.multimode)
{ {
OSD_Printf(CON_ERROR "Invalid player ID %d\n",line_num,keyw[tw],j); OSD_Printf(CON_ERROR "Invalid player ID %d\n",line_num,keyw[g_tw],j);
break; break;
} }
@ -7302,7 +7302,7 @@ static int parse(void)
insptr++; insptr++;
if (*(insptr+1) == 0) if (*(insptr+1) == 0)
{ {
OSD_Printf(CON_ERROR "Divide by zero.\n",line_num,keyw[tw]); OSD_Printf(CON_ERROR "Divide by zero.\n",line_num,keyw[g_tw]);
insptr += 2; insptr += 2;
break; break;
} }
@ -7314,7 +7314,7 @@ static int parse(void)
insptr++; insptr++;
if (*(insptr+1) == 0) if (*(insptr+1) == 0)
{ {
OSD_Printf(CON_ERROR "Mod by zero.\n",line_num,keyw[tw]); OSD_Printf(CON_ERROR "Mod by zero.\n",line_num,keyw[g_tw]);
insptr += 2; insptr += 2;
break; break;
} }
@ -7363,7 +7363,7 @@ static int parse(void)
j=GetGameVarID(*insptr++, g_i, g_p); j=GetGameVarID(*insptr++, g_i, g_p);
if (j<0 || j>=MAX_WEAPONS) if (j<0 || j>=MAX_WEAPONS)
{ {
OSD_Printf(CON_ERROR "Invalid weapon ID %d\n",line_num,keyw[tw],j); OSD_Printf(CON_ERROR "Invalid weapon ID %d\n",line_num,keyw[g_tw],j);
insptr++; insptr++;
break; break;
} }
@ -7375,7 +7375,7 @@ static int parse(void)
j=GetGameVarID(*insptr++, g_i, g_p); j=GetGameVarID(*insptr++, g_i, g_p);
if (j<0 || j>=MAX_WEAPONS) if (j<0 || j>=MAX_WEAPONS)
{ {
OSD_Printf(CON_ERROR "Invalid weapon ID %d\n",line_num,keyw[tw],j); OSD_Printf(CON_ERROR "Invalid weapon ID %d\n",line_num,keyw[g_tw],j);
insptr++; insptr++;
break; break;
} }
@ -7396,7 +7396,7 @@ static int parse(void)
if (l2==0) if (l2==0)
{ {
OSD_Printf(CON_ERROR "Divide by zero.\n",line_num,keyw[tw]); OSD_Printf(CON_ERROR "Divide by zero.\n",line_num,keyw[g_tw]);
break; break;
} }
SetGameVarID(j, GetGameVarID(j, g_i, g_p)/l2 , g_i, g_p); SetGameVarID(j, GetGameVarID(j, g_i, g_p)/l2 , g_i, g_p);
@ -7411,7 +7411,7 @@ static int parse(void)
if (l2==0) if (l2==0)
{ {
OSD_Printf(CON_ERROR "Mod by zero.\n",line_num,keyw[tw]); OSD_Printf(CON_ERROR "Mod by zero.\n",line_num,keyw[g_tw]);
break; break;
} }
@ -7517,7 +7517,7 @@ static int parse(void)
else music_select=(ud.volume_number*MAXLEVELS)+(GetGameVarID(*(insptr++), g_i, g_p)); else music_select=(ud.volume_number*MAXLEVELS)+(GetGameVarID(*(insptr++), g_i, g_p));
if (map[(unsigned char)music_select].musicfn == NULL) if (map[(unsigned char)music_select].musicfn == NULL)
{ {
OSD_Printf(CON_ERROR "null music for map %d\n",line_num,keyw[tw],music_select); OSD_Printf(CON_ERROR "null music for map %d\n",line_num,keyw[g_tw],music_select);
insptr++; insptr++;
break; break;
} }
@ -7687,7 +7687,7 @@ static int parse(void)
if (g_player[g_p].ps->boot_amount != *insptr) j = 1; if (g_player[g_p].ps->boot_amount != *insptr) j = 1;
break; break;
default: default:
OSD_Printf(CON_ERROR "invalid inventory ID: %d\n",line_num,keyw[tw],*(insptr-1)); OSD_Printf(CON_ERROR "invalid inventory ID: %d\n",line_num,keyw[g_tw],*(insptr-1));
} }
parseifelse(j); parseifelse(j);
@ -7744,14 +7744,14 @@ static int parse(void)
if (fta_quotes[*insptr] == NULL) if (fta_quotes[*insptr] == NULL)
{ {
OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[tw],*insptr); OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[g_tw],*insptr);
insptr++; insptr++;
break; break;
} }
if (g_p < 0 || g_p >= MAXPLAYERS) if (g_p < 0 || g_p >= MAXPLAYERS)
{ {
OSD_Printf(CON_ERROR "bad player for quote %d: (%d)\n",line_num,keyw[tw],*insptr,g_p); OSD_Printf(CON_ERROR "bad player for quote %d: (%d)\n",line_num,keyw[g_tw],*insptr,g_p);
insptr++; insptr++;
break; break;
} }
@ -7766,7 +7766,7 @@ static int parse(void)
if (fta_quotes[i] == NULL) if (fta_quotes[i] == NULL)
{ {
OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[tw],i); OSD_Printf(CON_ERROR "null quote %d\n",line_num,keyw[g_tw],i);
break; break;
} }
adduserquote(fta_quotes[i]); adduserquote(fta_quotes[i]);