Hi, I feel rather stupid asking this but I’m not really sure how to read a client side CVAR I have setup.
This is the code I have added:
glocal.h
extern vmCvar_t g_tracemap_size; // size of the tracemap to generate
Then ing_main.c
vmCvar_t g_tracemap_size; // User Size of tracemap for generation only
{ &g_tracemap_size, "g_tracemap_size", "1024", CVAR_ARCHIVE },
Now when i try to use this in bg_tracemap.c I the following code:
#ifdef CGAMEDLL
info = CG_ConfigString(CS_SERVERINFO);
s = Info_ValueForKey(info, "g_tracemap_size");
if (s)
c_tracemap_size = atoi(s);
#elif GAMEDLL
c_tracemap_size = g_tracemap_size.integer;
#endif
CG_Printf("Tracemap size is %i
",c_tracemap_size);
Now this always returns the value of 0 regaurdless of what I have set g_tracemap_size to. When type in \g_tracemap_size in the console it says it is for example 1024 (default 1024) which is all cool it’s just when I try to use it, then nothing.
Sorry if you think I’m a pain, I’m just trying to get my head around this and it hurts. (Probably those 10 or so pints of Killkenny and the hald a dozen Sambucas from yesterday)
Thanks for any help I get. I sort of think that maybe this code should be setup in cgmain.c (hmmmmm)