Bug 3738 - Quick cvar toggle method between 0/1 via Cvar_Command
Status: RESOLVED WONTFIX
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:
: 3739
Depends on:
Blocks:
 
Reported: 2008-08-08 21:13 EDT by ensiform
Modified: 2009-10-07 04:26:01 EDT
1 user (show)

See Also:



Description ensiform 2008-08-08 21:13:46 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.
Comment 1 Zachary J. Slater 2008-08-08 23:39:31 EDT
*** Bug 3739 has been marked as a duplicate of this bug. ***
Comment 2 Amanieu d'Antras 2008-08-09 02:06:55 EDT
Doesn't /toggle already do this?
Comment 3 Ben Noordhuis 2008-08-09 05:30:16 EDT
Yep.
Comment 4 Thilo Schulz 2009-10-07 04:26:01 EDT
why another method?