int eval_pitch_speed;
int eval_viewmodelforclient;
int eval_nodrawtoclient;
+int eval_exteriormodeltoclient;
int eval_drawonlytoclient;
int eval_colormod;
int eval_ping;
return d->ofs*4;
}
-void FindEdictFieldOffsets()
+void FindEdictFieldOffsets(void)
{
eval_gravity = FindFieldOffset("gravity");
eval_button3 = FindFieldOffset("button3");
eval_pitch_speed = FindFieldOffset("pitch_speed");
eval_viewmodelforclient = FindFieldOffset("viewmodelforclient");
eval_nodrawtoclient = FindFieldOffset("nodrawtoclient");
+ eval_exteriormodeltoclient = FindFieldOffset("exteriormodeltoclient");
eval_drawonlytoclient = FindFieldOffset("drawonlytoclient");
eval_colormod = FindFieldOffset("colormod");
eval_ping = FindFieldOffset("ping");
return NULL;
}
-
/*
============
ED_FindGlobal
*/
char *PR_ValueString (etype_t type, eval_t *val)
{
- static char line[256];
+ static char line[1024]; // LordHavoc: enlarged a bit (was 256)
ddef_t *def;
dfunction_t *f;
sprintf (line, "void");
break;
case ev_float:
- sprintf (line, "%5.1f", val->_float);
+ // LordHavoc: changed from %5.1f to %10.4f
+ sprintf (line, "%10.4f", val->_float);
break;
case ev_vector:
- sprintf (line, "'%5.1f %5.1f %5.1f'", val->vector[0], val->vector[1], val->vector[2]);
+ // LordHavoc: changed from %5.1f to %10.4f
+ sprintf (line, "'%10.4f %10.4f %10.4f'", val->vector[0], val->vector[1], val->vector[2]);
break;
case ev_pointer:
sprintf (line, "pointer");
For debugging
=============
*/
-// LordHavoc: optimized this to print out much more quickly
+// LordHavoc: optimized this to print out much more quickly (tempstring)
void ED_Print (edict_t *ed)
{
int l;
continue;
strcat(tempstring, name);
- l = strlen (name);
- while (l++ < 15)
+ for (l = strlen(name);l < 14;l++)
strcat(tempstring, " ");
+ strcat(tempstring, " ");
strcat(tempstring, PR_ValueString(d->type, (eval_t *)v));
strcat(tempstring, "\n");
continue;
type &= ~DEF_SAVEGLOBAL;
- if (type != ev_string
- && type != ev_float
- && type != ev_entity)
+ if (type != ev_string && type != ev_float && type != ev_entity)
continue;
name = pr_strings + def->s_name;
}
+void PR_Fields_f (void)
+{
+ int i;
+ if (!sv.active)
+ {
+ Con_Printf("no progs loaded\n");
+ return;
+ }
+ for (i = 0;i < progs->numfielddefs;i++)
+ Con_Printf("%s\n", (pr_strings + pr_fielddefs[i].s_name));
+ Con_Printf("%i entity fields, totalling %i bytes per edict, %i edicts, %i bytes total spent on edict fields\n", progs->entityfields, progs->entityfields * 4, MAX_EDICTS, progs->entityfields * 4 * MAX_EDICTS);
+}
+
+void PR_Globals_f (void)
+{
+ int i;
+ if (!sv.active)
+ {
+ Con_Printf("no progs loaded\n");
+ return;
+ }
+ for (i = 0;i < progs->numglobaldefs;i++)
+ Con_Printf("%s\n", (pr_strings + pr_globaldefs[i].s_name));
+ Con_Printf("%i global variables, totalling %i bytes\n", progs->numglobals, progs->numglobals * 4);
+}
+
/*
===============
PR_Init
Cmd_AddCommand ("edicts", ED_PrintEdicts);
Cmd_AddCommand ("edictcount", ED_Count);
Cmd_AddCommand ("profile", PR_Profile_f);
+ Cmd_AddCommand ("pr_fields", PR_Fields_f);
+ Cmd_AddCommand ("pr_globals", PR_Globals_f);
Cvar_RegisterVariable (&pr_checkextension);
Cvar_RegisterVariable (&nomonsters);
Cvar_RegisterVariable (&gamecfg);