mirror of
https://github.com/ZDoom/acc.git
synced 2024-11-14 08:31:05 +00:00
added new event script type
This commit is contained in:
parent
af77c7cd57
commit
495e6b2142
6 changed files with 19 additions and 0 deletions
1
error.c
1
error.c
|
@ -178,6 +178,7 @@ static struct
|
|||
{ ERR_HEXEN_COMPAT, "Attempt to use feature not supported by Hexen." },
|
||||
{ ERR_NOT_HEXEN, "Cannot save; new features are not compatible with Hexen." },
|
||||
{ ERR_SPECIAL_RANGE, "Line specials with values higher than 255 require #nocompact." },
|
||||
{ ERR_EVENT_NEEDS_2_ARG, "Event scripts must have 2 arguments." }, // [BB]
|
||||
{ ERR_NONE, NULL }
|
||||
};
|
||||
|
||||
|
|
1
error.h
1
error.h
|
@ -146,6 +146,7 @@ typedef enum
|
|||
ERR_HEXEN_COMPAT,
|
||||
ERR_NOT_HEXEN,
|
||||
ERR_SPECIAL_RANGE,
|
||||
ERR_EVENT_NEEDS_2_ARG // [BB]
|
||||
} error_t;
|
||||
|
||||
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
||||
|
|
14
parse.c
14
parse.c
|
@ -340,6 +340,7 @@ static struct ScriptTypes ScriptCounts[] =
|
|||
{ "disconnect", DISCONNECT_SCRIPTS_BASE, 0 },
|
||||
{ "unloading", UNLOADING_SCRIPTS_BASE, 0 },
|
||||
{ "return", RETURN_SCRIPTS_BASE, 0 },
|
||||
{ "event", EVENT_SCRIPTS_BASE, 0 },
|
||||
{ NULL, -1, 0 }
|
||||
};
|
||||
|
||||
|
@ -660,6 +661,14 @@ static void OuterScript(void)
|
|||
ERR_Error(ERR_UNCLOSED_WITH_ARGS, YES);
|
||||
break;
|
||||
|
||||
case TK_EVENT:
|
||||
scriptType = EVENT_SCRIPTS_BASE;
|
||||
if(ScriptVarCount != 2)
|
||||
{
|
||||
ERR_Error(ERR_EVENT_NEEDS_2_ARG, YES);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
TK_Undo();
|
||||
}
|
||||
|
@ -718,6 +727,11 @@ static void OuterScript(void)
|
|||
ERR_Error (ERR_DISCONNECT_NEEDS_1_ARG, YES);
|
||||
break;
|
||||
|
||||
case TK_EVENT: // [BB]
|
||||
scriptType = EVENT_SCRIPTS_BASE;
|
||||
ERR_Error (ERR_EVENT_NEEDS_2_ARG, YES);
|
||||
break;
|
||||
|
||||
default:
|
||||
ERR_Error(ERR_BAD_SCRIPT_DECL, YES);
|
||||
SkipBraceBlock(0);
|
||||
|
|
1
pcode.h
1
pcode.h
|
@ -30,6 +30,7 @@ enum
|
|||
UNLOADING_SCRIPTS_BASE = 13,
|
||||
DISCONNECT_SCRIPTS_BASE = 14,
|
||||
RETURN_SCRIPTS_BASE = 15,
|
||||
EVENT_SCRIPTS_BASE = 16, // [BB]
|
||||
};
|
||||
|
||||
// Values to indicate script flags (requires new-style .o)
|
||||
|
|
1
token.c
1
token.c
|
@ -192,6 +192,7 @@ static struct keyword_s
|
|||
{ "net", TK_NET },
|
||||
{ "clientside", TK_CLIENTSIDE }, // [BB]
|
||||
{ "disconnect", TK_DISCONNECT },
|
||||
{ "event", TK_EVENT }, //[BB]
|
||||
{ "unloading", TK_UNLOADING },
|
||||
{ "static", TK_STATIC },
|
||||
{ "strparam", TK_STRPARAM_EVAL }, // [FDARI]
|
||||
|
|
1
token.h
1
token.h
|
@ -122,6 +122,7 @@ typedef enum
|
|||
TK_NET, // 'net'
|
||||
TK_CLIENTSIDE, // 'clientside'
|
||||
TK_DISCONNECT, // 'disconnect'
|
||||
TK_EVENT, // 'event' [BB]
|
||||
TK_UNLOADING, // 'unloading'
|
||||
TK_STATIC, // 'static'
|
||||
TK_ANDASSIGN, // '&='
|
||||
|
|
Loading…
Reference in a new issue