What platform would you run Quetoo on if it was on Steam?:

Cvar problem

December 21, 2009 - 11:23am

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;

-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

-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 :/


December 25, 2009 - 09:09am

thx jdolan, this solved it http://pastebin.com/m32615553 :)

December 21, 2009 - 11:35am

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?

December 21, 2009 - 11:48am

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);