Bug 3739 - Quick cvar toggle method between 0/1 via Cvar_Command
Status: RESOLVED DUPLICATE of bug 3738
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: unspecified
Hardware: PC All
: P3 enhancement
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2008-08-08 21:15 EDT by ensiform
Modified: 2008-08-08 23:39:31 EDT
0 users

See Also:



Description ensiform 2008-08-08 21:15:11 EDT
Index: cvar.c
===================================================================
--- cvar.c	(revision 164)
+++ cvar.c	(working copy)
@@ -686,6 +686,14 @@
 		return qtrue;
 	}
 
+	if ( Cmd_Argc() == 2 ) {
+		if ( strcmp(Cmd_Argv(1), "!") == 0 ) {
+			int curValue = v->value;
+			Cvar_Set2(v->name, va("%i", !curValue), qfalse);
+			return qtrue;
+		}
+	}
+
 	// set the value if forcing isn't required
 	Cvar_Set2 (v->name, Cmd_Argv(1), qfalse);
 	return qtrue;


revision number is of my svn and not main ioq3 svn.

This allows for doing /cvarname ! as another method for toggling between 0 and 1 on boolean vars.
Comment 1 Zachary J. Slater 2008-08-08 23:39:31 EDT

*** This bug has been marked as a duplicate of bug 3738 ***