- Let puke and pukename take up to four script parameters.

- Pass ACS_ExecuteWithResult's fifth argument as a fourth script parameter.
- Simplify P_StartScript()'s usage.

SVN r3394 (trunk)
This commit is contained in:
Randy Heit 2012-02-26 03:36:05 +00:00
commit 1e21ebad5d
10 changed files with 117 additions and 89 deletions

View file

@ -59,11 +59,9 @@
#include "m_argv.h"
#include "p_lnspec.h"
#include "v_video.h"
#include "p_spec.h"
#include "intermission/intermission.h"
int P_StartScript (AActor *who, line_t *where, int script, char *map, bool backSide,
int arg0, int arg1, int arg2, int always, bool wantResultCode, bool net);
EXTERN_CVAR (Int, disableautosave)
EXTERN_CVAR (Int, autosavecount)
@ -122,7 +120,7 @@ void G_BuildTiccmd (ticcmd_t *cmd);
void D_DoAdvanceDemo (void);
static void SendSetup (DWORD playersdetected[MAXNETNODES], BYTE gotsetup[MAXNETNODES], int len);
static void RunScript(BYTE **stream, APlayerPawn *pawn, int snum, int argn, bool always);
static void RunScript(BYTE **stream, APlayerPawn *pawn, int snum, int argn, int always);
int reboundpacket;
BYTE reboundstore[MAX_MSGLEN];
@ -2317,7 +2315,7 @@ void Net_DoCommand (int type, BYTE **stream, int player)
int snum = ReadWord (stream);
int argn = ReadByte (stream);
RunScript(stream, players[player].mo, snum, argn, type == DEM_RUNSCRIPT2);
RunScript(stream, players[player].mo, snum, argn, (type == DEM_RUNSCRIPT2) ? ACS_ALWAYS : 0);
}
break;
@ -2326,7 +2324,7 @@ void Net_DoCommand (int type, BYTE **stream, int player)
char *sname = ReadString(stream);
int argn = ReadByte(stream);
RunScript(stream, players[player].mo, -FName(sname), argn & 127, !!(argn & 128));
RunScript(stream, players[player].mo, -FName(sname), argn & 127, (argn & 128) ? ACS_ALWAYS : 0);
}
break;
@ -2472,9 +2470,9 @@ void Net_DoCommand (int type, BYTE **stream, int player)
}
// Used by DEM_RUNSCRIPT, DEM_RUNSCRIPT2, and DEM_RUNNAMEDSCRIPT
static void RunScript(BYTE **stream, APlayerPawn *pawn, int snum, int argn, bool always)
static void RunScript(BYTE **stream, APlayerPawn *pawn, int snum, int argn, int always)
{
int arg[3] = { 0, 0, 0 };
int arg[4] = { 0, 0, 0, 0 };
int i;
for (i = 0; i < argn; ++i)
@ -2485,8 +2483,7 @@ static void RunScript(BYTE **stream, APlayerPawn *pawn, int snum, int argn, bool
arg[i] = argval;
}
}
P_StartScript (pawn, NULL, snum, level.mapname, false,
arg[0], arg[1], arg[2], always, false, true);
P_StartScript(pawn, NULL, snum, level.mapname, arg, MIN<int>(countof(arg), argn), ACS_NET);
}
void Net_SkipCommand (int type, BYTE **stream)