mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +00:00
new cvar: sv_hide_version_info. This hides QuakeForge specific info strings
from progs.
This commit is contained in:
parent
8e9505c100
commit
4ae92c8d42
3 changed files with 34 additions and 1 deletions
|
@ -382,6 +382,7 @@ typedef enum
|
|||
//============================================================================
|
||||
// FIXME: declare exported variables in their own relevant .h
|
||||
|
||||
extern struct cvar_s *sv_hide_version_info;
|
||||
extern struct cvar_s *sv_highchars;
|
||||
|
||||
extern struct cvar_s *sv_mintic, *sv_maxtic;
|
||||
|
|
|
@ -1248,10 +1248,17 @@ PF_infokey (progs_t *pr)
|
|||
e1 = NUM_FOR_EDICT (pr, e);
|
||||
key = G_STRING (pr, OFS_PARM1);
|
||||
|
||||
if (sv_hide_version_info->int_val
|
||||
&& (strequal (key, "*qf_version")
|
||||
|| strequal (key, "*qsg_version")
|
||||
|| strequal (key, "no_pogo_stick"))) {
|
||||
e1 = -1;
|
||||
}
|
||||
|
||||
if (e1 == 0) {
|
||||
if ((value = Info_ValueForKey (svs.info, key)) == NULL || !*value)
|
||||
value = Info_ValueForKey (localinfo, key);
|
||||
} else if (e1 <= MAX_CLIENTS) {
|
||||
} else if (e1 > 0 && e1 <= MAX_CLIENTS) {
|
||||
if (!strcmp (key, "ip"))
|
||||
value =
|
||||
strcpy (ov,
|
||||
|
@ -1572,11 +1579,30 @@ PF_Checkextension (progs_t *pr)
|
|||
G_FLOAT(pr, OFS_RETURN) = 0; //FIXME make this function actually useful :P
|
||||
}
|
||||
|
||||
static void
|
||||
PF_sv_cvar (progs_t *pr)
|
||||
{
|
||||
const char *str;
|
||||
|
||||
str = G_STRING (pr, OFS_PARM0);
|
||||
|
||||
if (sv_hide_version_info->int_val
|
||||
&& strequal (str, "sv_hide_version_info")) {
|
||||
G_FLOAT (pr, OFS_RETURN) = 0;
|
||||
} else {
|
||||
G_FLOAT (pr, OFS_RETURN) = Cvar_VariableValue (str);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SV_PR_Cmds_Init ()
|
||||
{
|
||||
PR_Cmds_Init (&sv_pr_state);
|
||||
|
||||
sv_pr_state.builtins[45].proc = 0; // (override standard builtin)
|
||||
PR_AddBuiltin (&sv_pr_state, "cvar", PF_sv_cvar, 45);
|
||||
// float (string s) cvar
|
||||
|
||||
PR_AddBuiltin (&sv_pr_state, "makevectors", PF_makevectors, 1);
|
||||
// void (entity e) makevectors = #1
|
||||
PR_AddBuiltin (&sv_pr_state, "setorigin", PF_setorigin, 2);
|
||||
|
|
|
@ -55,6 +55,7 @@ cvar_t *r_skyname;
|
|||
cvar_t *sv_progs;
|
||||
cvar_t *pr_checkextensions;
|
||||
cvar_t *sv_old_entity_free;
|
||||
cvar_t *sv_hide_version_info;
|
||||
|
||||
func_t EndFrame;
|
||||
func_t SpectatorConnect;
|
||||
|
@ -389,4 +390,9 @@ SV_Progs_Init_Cvars (void)
|
|||
"set this for buggy mods that rely on the"
|
||||
" old behaviour of entity freeing (eg,"
|
||||
" *TF)");
|
||||
sv_hide_version_info = Cvar_Get ("sv_hide_version_info", "0", CVAR_ROM,
|
||||
NULL, "hide QuakeForge specific "
|
||||
"serverinfo strings from terminally "
|
||||
"stupid progs (eg, braindead TF "
|
||||
"variants)");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue