This is better.

git-svn-id: https://svn.eduke32.com/eduke32@254 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-08-03 03:14:43 +00:00
parent 5b211422da
commit f467ebaf3e

View file

@ -110,11 +110,12 @@ enum errors {
enum labeltypes {
LABEL_ANY = -1,
LABEL_ACTION = 1,
LABEL_AI = 2,
LABEL_DEFINE = 4,
LABEL_MOVE = 8,
LABEL_STATE = 16,
LABEL_DEFINE = 1,
LABEL_STATE = 2,
LABEL_ACTOR = 4,
LABEL_ACTION = 8,
LABEL_AI = 16,
LABEL_MOVE = 32,
};
static char *labeltypenames[] = {
@ -2248,7 +2249,7 @@ char parsecommand(void)
if(!CheckEventSync(current_event))
ReportError(WARNING_EVENTSYNC);
if((transnum(LABEL_MOVE) != LABEL_MOVE) && (*(scriptptr-1) != 0))
if((transnum(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(scriptptr-1) != 0) && (*(scriptptr-1) != 1))
{
error++;
ReportError(ERROR_SYNTAXERROR);
@ -2481,7 +2482,11 @@ char parsecommand(void)
transnum(LABEL_ACTION);
else if(j == 2)
{
transnum(LABEL_MOVE);
if((transnum(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(scriptptr-1) != 0) && (*(scriptptr-1) != 1))
{
error++;
ReportError(ERROR_SYNTAXERROR);
}
k = 0;
while(keyword() == -1)
{
@ -2601,7 +2606,13 @@ char parsecommand(void)
{
case 0: transnum(LABEL_DEFINE); break;
case 1: transnum(LABEL_ACTION); break;
case 2: transnum(LABEL_MOVE|LABEL_DEFINE); break;
case 2:
if((transnum(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(scriptptr-1) != 0) && (*(scriptptr-1) != 1))
{
error++;
ReportError(ERROR_SYNTAXERROR);
}
break;
}
*(parsing_actor+j) = *(scriptptr-1);
}
@ -2740,7 +2751,13 @@ char parsecommand(void)
{
case 0: transnum(LABEL_DEFINE); break;
case 1: transnum(LABEL_ACTION); break;
case 2: transnum(LABEL_MOVE|LABEL_DEFINE); break;
case 2:
if((transnum(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(scriptptr-1) != 0) && (*(scriptptr-1) != 1))
{
error++;
ReportError(ERROR_SYNTAXERROR);
}
break;
}
*(parsing_actor+j) = *(scriptptr-1);
}
@ -4167,7 +4184,11 @@ repeatcase:
transnum(LABEL_ACTION);
break;
case CON_IFMOVE:
transnum(LABEL_MOVE);
if((transnum(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(scriptptr-1) != 0) && (*(scriptptr-1) != 1))
{
error++;
ReportError(ERROR_SYNTAXERROR);
}
break;
case CON_IFPINVENTORY:
transnum(LABEL_DEFINE);