Bug 4357 - CVAR_ROM+CVAR_ARCHIVE is not read from q3config.
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-11-26 22:22 EST by Poul Sander
Modified: 2010-01-03 14:45:29 EST
3 users (show)

See Also:


Attachments
Remove the CVAR_ROM flag from single player states (1.19 KB, patch)
2009-12-14 05:11 EST, Dominic Fandrey

Description Poul Sander 2009-11-26 22:22:25 EST
Since r1745 vm defined cvars that has both cvar_rom and cvar_archive does not get restored from q3config.cfg (they are written corrently). The most noteble example is g_spScores*.

The problem appears to be this channge:
-		if ( ( var->flags & CVAR_USER_CREATED ) && !( flags & CVAR_USER_CREATED )
-			&& var_value[0] ) {
+		if(var->flags & CVAR_USER_CREATED)
+		{

Changing the line into:
if( (flags & CVAR_ROM) && !(flags & CVAR_ARCHIVE) ) {
can be used as a workaround.

I am not sure what is the best solution as it might break the game restart reset function.

Should values read from q3config even be marked as user created in the first place?
Comment 1 Dominic Fandrey 2009-12-08 08:17:15 EST
I can confirm this bug with r1753 on FreeBSD amd64.

Very annoying.
Comment 2 Dominic Fandrey 2009-12-14 05:11:55 EST
Created attachment 2219 [details]
Remove the CVAR_ROM flag from single player states

I think it's cleaner to remove the ROM flag from the single player states. This is a cheap in-game security feature that could always be circumvented by changing the values in the config file.
Comment 3 Poul Sander 2009-12-14 05:29:02 EST
(In reply to comment #2)
> Remove the CVAR_ROM flag from single player states
Absolutely the best way. Unfortunately it is not possible. There might be hundreds of mods relying on the old behavior including vanilla Q3 and that cannot be changed.
Comment 4 Dominic Fandrey 2009-12-15 06:34:44 EST
(In reply to comment #3)
> (In reply to comment #2)
> > Remove the CVAR_ROM flag from single player states
> Absolutely the best way. Unfortunately it is not possible. There might be
> hundreds of mods relying on the old behavior including vanilla Q3 and that
> cannot be changed.

That'd mean the original changes would have to be undone. I tried a handful of mods and couldn't produce problems.

If at all it only should affect single player mods. I tested none of these.
Comment 5 Thilo Schulz 2009-12-28 12:09:21 EST
I made this change deliberately, because reverting it back to the old behaviour would allow any values that are declared read-only to be modified by the user. I didn't know at that time that some features of the game rely on this "bug".
Comment 6 Tim Angus 2010-01-03 14:45:29 EST
Fixed in r1760. Technically it was getting read from q3config, it's just that it gets reset to the default when the ui module (later) registers the cvar.