I have a little problem with a cvar I created.
-I defined the cvar on top of g_main.c next to the others: cvar_t *g_debug;
cvar_t *g_debug;
-Then I initialized it in G_Init(): g_debug = gi.Cvar("g_debug", "0", CVAR_SERVERINFO, "Displays debug information"); I also tried with CVAR_USERINFO
g_debug = gi.Cvar("g_debug", "0", CVAR_SERVERINFO, "Displays debug information");
-I use the cvar in this code http://pastebin.com/m4646e386
The problem is that after enabling and then disabling the cvar in game I can no longer re-enable it, I mean it does not allow to display the info in the code above.
I also tried with g_debug->modified = false; in G_Init() with no luck :/
thx
thx jdolan, this solved it http://pastebin.com/m32615553 :)
Did you try not using any CVAR_* flags? You do not need any. CVAR_USERINFO is certainly wrong. CVAR_SERVERINFO is not necessary. Pass 0, e.g.
g_debug = gi.Cvar("g_debug", "0", 0, "Displays debug information");
Also, where is the code which calls your function?
I just tried with g_debug = gi.Cvar("g_debug", "0", 0, "Displays debug information"); but I am still having the same problem.
The code which calls my function is located inside P_EndServerFrames() right after the call to P_EndServerFrame(ent);
P_EndServerFrame(ent);