ddef_t *ED_FieldAtOfs(int ofs);
qboolean ED_ParseEpair(edict_t *ent, ddef_t *key, const char *s);
-cvar_t pr_checkextension = {0, "pr_checkextension", "1"};
+cvar_t pr_checkextension = {CVAR_READONLY, "pr_checkextension", "1"};
cvar_t nomonsters = {0, "nomonsters", "0"};
cvar_t gamecfg = {0, "gamecfg", "0"};
cvar_t scratch1 = {0, "scratch1", "0"};
Returns a string describing *data in a type specific manner
=============
*/
-int NoCrash_NUM_FOR_EDICT(edict_t *e);
+//int NoCrash_NUM_FOR_EDICT(edict_t *e);
char *PR_ValueString (etype_t type, eval_t *val)
{
static char line[1024]; // LordHavoc: enlarged a bit (was 256)
FS_Printf (f,"}\n");
}
+/*
+=============
+ED_EdictSet_f
+
+Console command to set a field of a specified edict
+=============
+*/
+void ED_EdictSet_f(void)
+{
+ edict_t *ed;
+ ddef_t *key;
+
+ if(Cmd_Argc() != 4)
+ {
+ Con_Printf("edictset <edict number> <field> <value>\n");
+ return;
+ }
+ ed = EDICT_NUM(atoi(Cmd_Argv(1)));
+
+ if((key = ED_FindField(Cmd_Argv(2))) == 0)
+ {
+ Con_Printf("Key %s not found !\n", Cmd_Argv(2));
+ return;
+ }
+
+ ED_ParseEpair(ed, key, Cmd_Argv(3));
+}
+
/*
=============
ED_ParseGlobals
Cmd_AddCommand ("edict", ED_PrintEdict_f);
Cmd_AddCommand ("edicts", ED_PrintEdicts);
Cmd_AddCommand ("edictcount", ED_Count);
+ Cmd_AddCommand ("edictset", ED_EdictSet_f);
Cmd_AddCommand ("profile", PR_Profile_f);
Cmd_AddCommand ("pr_fields", PR_Fields_f);
Cmd_AddCommand ("pr_globals", PR_Globals_f);