[gamecode] Run an audit of progs parameter setup

nq was just a bit of whitespace, but qw had an actual bug where the
parameters were not being reset before writing to them. It really
doesn't help that I don't know where to get progs suitable for testing
(really don't what to have to write my own).
This commit is contained in:
Bill Currie 2022-01-22 16:00:04 +09:00
parent 9e4ecc14e9
commit 234f2212d6
3 changed files with 3 additions and 4 deletions

View file

@ -386,8 +386,7 @@ SV_DropClient (qboolean crash)
// call the prog function for removing a client
// this will set the body to a dead frame, among other things
saveSelf = *sv_globals.self;
*sv_globals.self =
EDICT_TO_PROG (&sv_pr_state, host_client->edict);
*sv_globals.self = EDICT_TO_PROG (&sv_pr_state, host_client->edict);
PR_ExecuteProgram (&sv_pr_state, sv_funcs.ClientDisconnect);
*sv_globals.self = saveSelf;
}

View file

@ -1087,8 +1087,7 @@ SV_SaveSpawnparms (void)
continue;
// call the progs to get default spawn parms for the new client
*sv_globals.self =
EDICT_TO_PROG (&sv_pr_state, host_client->edict);
*sv_globals.self = EDICT_TO_PROG (&sv_pr_state, host_client->edict);
PR_ExecuteProgram (&sv_pr_state, sv_funcs.SetChangeParms);
for (j = 0; j < NUM_SPAWN_PARMS; j++)
host_client->spawn_parms[j] = sv_globals.parms[j];

View file

@ -817,6 +817,7 @@ cpqw_user_cmd (void)
*sv_globals.self = EDICT_TO_PROG (&sv_pr_state, sv_player);
PR_PushFrame (pr);
PR_RESET_PARAMS (pr);
P_FLOAT (pr, 0) = argc;
for (i = 1; i < argc + 1; i++)
P_STRING (pr, i) = PR_SetTempString (pr, Cmd_Argv (i - 1));