Bug 4369 - Cvar modified flags are not updated in Cvar_Get
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: GIT MASTER
Hardware: All All
: P3 normal
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2009-12-07 22:31 EST by Chris "Lakitu7" Schwarz
Modified: 2009-12-18 18:13:18 EST
1 user (show)

See Also:


Attachments
patch against 1753 (623 bytes, patch)
2009-12-07 22:31 EST, Chris "Lakitu7" Schwarz

Description Chris "Lakitu7" Schwarz 2009-12-07 22:31:58 EST
Created attachment 2210 [details]
patch against 1753

Since revision 1745, cvar_modifiedFlags is not correctly updated in Cvar_Get().
As a result, actions which rely on this fail. Most specifically, cvars being
marked USERINFO or SERVERINFO are not being (re)sent upon receiving such a
flag. In the latest Tremulous release, this has manifested as all vm-created
userinfo cvars not taking effect until a player changes one of them, causing
Cvar_InfoString to re-fire and send them all. As it is now, without
cvar_modifiedFlags being updated, Cvar_InfoString does not re-run after the VMs
load, so these cvars are not added to the appropriate infostrings.

At r1745, the relevant lines:
 // ZOID--needs to be set so that cvars the game sets as 
 // SERVERINFO get sent to clients
 cvar_modifiedFlags |= flags;

were moved inside the block: 
  if ( var->latchedString ) {

I am guessing that this was unintentional, and actually it should have been
moved slightly below that, after the if( var->latchedString ) block. The
attached patch does this. I can't really think of any reason why we would only
want to update modifiedflags for latched cvars, but it makes sense that the
block should have been moved from its current location to the bottom after the
new stuff for CVAR_VM_CREATED. I confirmed that the attached patch fixes the
issue as I described in Tremulous, but certainly everything here should apply
to ioq3 unmodified as well.
Comment 1 Tim Angus 2009-12-18 18:13:18 EST
Fixed in r1757.