diff options
Diffstat (limited to 'src/jake2/qcommon/Cvar.java')
-rw-r--r-- | src/jake2/qcommon/Cvar.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/jake2/qcommon/Cvar.java b/src/jake2/qcommon/Cvar.java index d14cadd..c0aa6ab 100644 --- a/src/jake2/qcommon/Cvar.java +++ b/src/jake2/qcommon/Cvar.java @@ -2,7 +2,7 @@ * Cvar.java * Copyright (C) 2003 * - * $Id: Cvar.java,v 1.7 2005-02-08 18:00:02 cawe Exp $ + * $Id: Cvar.java,v 1.8 2005-05-26 16:56:32 hzi Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -294,10 +294,21 @@ public class Cvar extends Globals { /* * ============ Cvar_SetValue ============ */ - public static void SetValue(String var_name, float value) { + // the overloading is very important + // there was a problem with networt "rate" string + // 10000 became "10000.0" and that wasn't right + public static void SetValue(String var_name, int value) { Cvar.Set(var_name, "" + value); } + public static void SetValue(String var_name, float value) { + if (value == (int)value) { + Cvar.Set(var_name, "" + (int)value); + } else { + Cvar.Set(var_name, "" + value); + } + } + /* * ============ Cvar_VariableValue ============ */ |