mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-19 08:51:59 +00:00
- add a pr_double_remove cvar, that either ignores (0), warns about
(1), or causes a fatal error (2) when the progs remove an already removed entity. default is 1. - fix a segfault in FFnickFF parsing that causes a segfault
This commit is contained in:
parent
188688f835
commit
9f7e1f864e
3 changed files with 17 additions and 1 deletions
|
@ -1897,6 +1897,7 @@ SV_InitLocal (void)
|
|||
extern cvar_t *sv_wateraccelerate;
|
||||
extern cvar_t *sv_friction;
|
||||
extern cvar_t *sv_waterfriction;
|
||||
extern cvar_t *pr_double_remove;
|
||||
|
||||
SV_UserInit ();
|
||||
|
||||
|
@ -2056,6 +2057,12 @@ SV_InitLocal (void)
|
|||
pr_gc_interval = Cvar_Get ("pr_gc_interval", "50", CVAR_NONE, NULL,
|
||||
"Number of frames to wait before running "
|
||||
"string garbage collector.");
|
||||
pr_double_remove = Cvar_Get ("pr_double_remove", "1", CVAR_NONE, NULL,
|
||||
"Handling of double entity remove. "
|
||||
"0 is silently ignore, 1 prints a "
|
||||
"traceback, and 2 gives an error.\n"
|
||||
"Only works if debugging is available "
|
||||
"and enabled");
|
||||
// DoS protection
|
||||
Cmd_AddCommand ("netdosexpire", SV_netDoSexpire_f, "FIXME: part of DoS "
|
||||
"protection obviously, but I don't know what it does. No "
|
||||
|
|
|
@ -641,12 +641,21 @@ PF_Spawn (progs_t *pr)
|
|||
RETURN_EDICT (pr, ed);
|
||||
}
|
||||
|
||||
cvar_t *pr_double_remove;
|
||||
|
||||
void
|
||||
PF_Remove (progs_t *pr)
|
||||
{
|
||||
edict_t *ed;
|
||||
|
||||
ed = G_EDICT (pr, OFS_PARM0);
|
||||
if (ed->free && pr_double_remove->int_val) {
|
||||
if (pr_double_remove->int_val == 1) {
|
||||
PR_DumpState (pr);
|
||||
SV_Printf ("Double entity remove\n");
|
||||
} else // == 2
|
||||
PR_RunError (pr, "Double entity remove\n");
|
||||
}
|
||||
ED_Free (pr, ed);
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ SV_Print (const char *fmt, va_list args)
|
|||
int len;
|
||||
int i;
|
||||
|
||||
if (!*end)
|
||||
if (!end)
|
||||
end = in + strlen (in);
|
||||
*end = '\0';
|
||||
for (i = 0; i < MAX_CLIENTS; i++) {
|
||||
|
|
Loading…
Reference in a new issue