diff --git a/nq/source/pr_cmds.c b/nq/source/pr_cmds.c index 9210b9a0f..cd9a1186a 100644 --- a/nq/source/pr_cmds.c +++ b/nq/source/pr_cmds.c @@ -670,46 +670,6 @@ PF_localcmd (progs_t *pr) Cbuf_AddText (str); } -/* - PF_cvar - - float cvar (string) -*/ -void -PF_cvar (progs_t *pr) -{ - const char *str; - - str = G_STRING (pr, OFS_PARM0); - - G_FLOAT (pr, OFS_RETURN) = Cvar_VariableValue (str); -} - -/* - PF_cvar_set - - float cvar (string) -*/ -void -PF_cvar_set (progs_t *pr) -{ - const char *var_name, *val; - cvar_t *var; - - var_name = G_STRING (pr, OFS_PARM0); - val = G_STRING (pr, OFS_PARM1); - var = Cvar_FindVar (var_name); - if (!var) - var = Cvar_FindAlias (var_name); - if (!var) { - // FIXME: make Con_DPrint? - Con_Printf ("PF_cvar_set: variable %s not found\n", var_name); - return; - } - - Cvar_Set (var, val); -} - /* PF_findradius @@ -849,30 +809,6 @@ PF_precache_model (progs_t *pr) } -void -PF_coredump (progs_t *pr) -{ - ED_PrintEdicts (pr, ""); -} - -void -PF_traceon (progs_t *pr) -{ - pr->pr_trace = true; -} - -void -PF_traceoff (progs_t *pr) -{ - pr->pr_trace = false; -} - -void -PF_eprint (progs_t *pr) -{ - ED_PrintNum (pr, G_EDICTNUM (pr, OFS_PARM0)); -} - /* PF_walkmove @@ -977,31 +913,6 @@ PF_lightstyle (progs_t *pr) } } -void -PF_rint (progs_t *pr) -{ - float f; - - f = G_FLOAT (pr, OFS_PARM0); - if (f > 0) - G_FLOAT (pr, OFS_RETURN) = (int) (f + 0.5); - else - G_FLOAT (pr, OFS_RETURN) = (int) (f - 0.5); -} - -void -PF_floor (progs_t *pr) -{ - G_FLOAT (pr, OFS_RETURN) = floor (G_FLOAT (pr, OFS_PARM0)); -} - -void -PF_ceil (progs_t *pr) -{ - G_FLOAT (pr, OFS_RETURN) = ceil (G_FLOAT (pr, OFS_PARM0)); -} - - /* PF_checkbottom */ @@ -1028,32 +939,6 @@ PF_pointcontents (progs_t *pr) G_FLOAT (pr, OFS_RETURN) = SV_PointContents (v); } -/* - PF_nextent - - entity nextent(entity) -*/ -void -PF_nextent (progs_t *pr) -{ - int i; - edict_t *ent; - - i = G_EDICTNUM (pr, OFS_PARM0); - while (1) { - i++; - if (i == sv.num_edicts) { - RETURN_EDICT (pr, sv.edicts); - return; - } - ent = EDICT_NUM (pr, i); - if (!ent->free) { - RETURN_EDICT (pr, ent); - return; - } - } -} - /* PF_aim diff --git a/qw/source/sv_pr_cmds.c b/qw/source/sv_pr_cmds.c index 476dd147a..3e6fd5a45 100644 --- a/qw/source/sv_pr_cmds.c +++ b/qw/source/sv_pr_cmds.c @@ -606,46 +606,6 @@ PF_localcmd (progs_t *pr) Cbuf_AddText (str); } -/* - PF_cvar - - float cvar (string) -*/ -void -PF_cvar (progs_t *pr) -{ - const char *str; - - str = G_STRING (pr, OFS_PARM0); - - G_FLOAT (pr, OFS_RETURN) = Cvar_VariableValue (str); -} - -/* - PF_cvar_set - - float cvar (string) -*/ -void -PF_cvar_set (progs_t *pr) -{ - const char *var_name, *val; - cvar_t *var; - - var_name = G_STRING (pr, OFS_PARM0); - val = G_STRING (pr, OFS_PARM1); - var = Cvar_FindVar (var_name); - if (!var) - var = Cvar_FindAlias (var_name); - if (!var) { - // FIXME: make Con_DPrint? - SV_Printf ("PF_cvar_set: variable %s not found\n", var_name); - return; - } - - Cvar_Set (var, val); -} - /* PF_findradius @@ -1662,7 +1622,6 @@ SV_PR_Cmds_Init () PR_AddBuiltin (&sv_pr_state, "checkbottom", PF_checkbottom, 40); // float(entity e) checkbottom = #40 PR_AddBuiltin (&sv_pr_state, "pointcontents", PF_pointcontents, 41); // float(vector v) pointcontents = #41 // no 42 - PR_AddBuiltin (&sv_pr_state, "cvar", PF_cvar, 45); // float(string s) cvar = #45 PR_AddBuiltin (&sv_pr_state, "localcmd", PF_localcmd, 46); // void(string s) localcmd = #46 // no 48 PR_AddBuiltin (&sv_pr_state, "changeyaw", PF_changeyaw, 49); // void() ChangeYaw = #49 @@ -1692,7 +1651,6 @@ SV_PR_Cmds_Init () PR_AddBuiltin (&sv_pr_state, "changelevel", PF_changelevel, 70); // void(string s) changelevel = #70 // 71 - PR_AddBuiltin (&sv_pr_state, "cvar_set", PF_cvar_set, 72); // void(string var, string val) cvar_set = #72 PR_AddBuiltin (&sv_pr_state, "centerprint", PF_centerprint, 73); // void(...) centerprint = #73 PR_AddBuiltin (&sv_pr_state, "ambientsound", PF_ambientsound, 74); // void(vector pos, string samp, float vol, float atten) ambientsound = #74