r1ch.net forums
* Home Help Search Login Register
r1ch.net  |  r1ch.net stuff  |  R1Q2  |  Topic: Quake2 bug
Pages: [1]
Print
Author Topic: Quake2 bug  (Read 4574 times)
Berserker
Guest
« on: April 09, 2011, 12:57:59 pm »

Quake2 and R1Q2(b7904) has bug:
for example:  cvar "basedir", CVAR_NOSET (write protected)
I will change "basedir":     set basedir blabla u

Fix:
cvar_t *Cvar_FullSet (char *var_name, char *value, int flags)
{
   cvar_t   *var;
   
   var = Cvar_FindVar (var_name);
   if (!var)
   {   // create it
      return Cvar_Get (var_name, value, flags);
   }

   /// Berserker: Fixed Q2 bug:    "set <cvar_NOSET> value u"    will modify the <cvar_NOSET> !!!
   if (var->flags & CVAR_NOSET)
   {
      Com_Printf ("^3%s is write protected.\n", var_name);
      return var;
   }

   var->modified = true;
   ...

Logged
mhanor
Member

Posts: 120


« Reply #1 on: April 09, 2011, 03:48:52 pm »

The game dll (and/or r1q2 itself, I don't remember exactly, it's old stuff) can and does use Cvar_FullSet to overwrite readonly cvars, for it own purpose. Your solution is not good, read here:
http://www.r1ch.net/mantis/view.php?id=110
Logged
Pages: [1]
Print
r1ch.net  |  r1ch.net stuff  |  R1Q2  |  Topic: Quake2 bug
Jump to:  

Powered by SMF 1.1.19 | SMF © 2013, Simple Machines