- Added pukename console command. This is mostly the same as puke, except the scripts are

named, and to run a script using ACS_ExecuteAlways, you need to add "always" after the script
  name but before any arguments. e.g.:
    pukename "A Script" 1
  Will run the script "A Script" with a single argument of 1, provided the script is not 
  already running.
    pukename "A Script" always 1
  Will always run the script "A Script" with a single argument of 1.

SVN r3365 (trunk)
This commit is contained in:
Randy Heit 2012-02-16 22:13:46 +00:00
commit 8f516a1007
4 changed files with 76 additions and 14 deletions

View file

@ -489,6 +489,44 @@ CCMD (puke)
}
}
CCMD (pukename)
{
int argc = argv.argc();
if (argc < 2 || argc > 6)
{
Printf ("Usage: pukename \"<script>\" [\"always\"] [arg1] [arg2] [arg3]\n");
}
else
{
bool always = false;
int argstart = 2;
int arg[3] = { 0, 0, 0 };
int argn = 0, i;
if (argc > 2)
{
if (stricmp(argv[2], "always") == 0)
{
always = true;
argstart = 3;
}
argn = MIN(argc - argstart, 3);
for (i = 0; i < argn; ++i)
{
arg[i] = atoi(argv[argstart + i]);
}
}
Net_WriteByte(DEM_RUNNAMEDSCRIPT);
Net_WriteString(argv[1]);
Net_WriteByte(argn | (always << 7));
for (i = 0; i < argn; ++i)
{
Net_WriteLong(arg[i]);
}
}
}
CCMD (special)
{
int argc = argv.argc();