diff options
author | Carsten Weisse <[email protected]> | 2007-05-14 22:29:30 +0000 |
---|---|---|
committer | Carsten Weisse <[email protected]> | 2007-05-14 22:29:30 +0000 |
commit | 516da598492d8823ddb401167061e2ef63db08b3 (patch) | |
tree | 8370354bfccf9fe722fca051b6263309216b07d1 /src | |
parent | ec8d503cc6eaddfc2d18ee68d3ff8c558b0570ab (diff) |
use Lib.atof instead
Diffstat (limited to 'src')
-rw-r--r-- | src/jake2/client/CL_pred.java | 10 | ||||
-rw-r--r-- | src/jake2/qcommon/Cvar.java | 36 |
2 files changed, 10 insertions, 36 deletions
diff --git a/src/jake2/client/CL_pred.java b/src/jake2/client/CL_pred.java index dd44a30..0f0620b 100644 --- a/src/jake2/client/CL_pred.java +++ b/src/jake2/client/CL_pred.java @@ -2,7 +2,7 @@ * CL_pred.java * Copyright (C) 2004 * - * $Id: CL_pred.java,v 1.6 2004-10-04 12:50:37 hzi Exp $ + * $Id: CL_pred.java,v 1.7 2007-05-14 22:29:30 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -29,6 +29,7 @@ import jake2.Defines; import jake2.Globals; import jake2.game.*; import jake2.qcommon.*; +import jake2.util.Lib; import jake2.util.Math3D; /** @@ -251,12 +252,7 @@ public class CL_pred { } }; - try { - PMove.pm_airaccelerate = Float - .parseFloat(Globals.cl.configstrings[Defines.CS_AIRACCEL]); - } catch (Exception e) { - PMove.pm_airaccelerate = 0; - } + PMove.pm_airaccelerate = Lib.atof(Globals.cl.configstrings[Defines.CS_AIRACCEL]); // bugfix (rst) yeah !!!!!!!! found the solution to the B E W E G U N G // S P R O B L E M. diff --git a/src/jake2/qcommon/Cvar.java b/src/jake2/qcommon/Cvar.java index eaeba52..daa7071 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.9 2005-12-27 21:02:30 salomo Exp $ + * $Id: Cvar.java,v 1.10 2007-05-14 22:29:30 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -77,12 +77,7 @@ public class Cvar extends Globals { var.name = new String(var_name); var.string = new String(var_value); var.modified = true; - // handles atof(var.string) - try { - var.value = Float.parseFloat(var.string); - } catch (NumberFormatException e) { - var.value = 0.0f; - } + var.value = Lib.atof(var.string); // link the variable in var.next = Globals.cvar_vars; Globals.cvar_vars = var; @@ -131,12 +126,7 @@ public class Cvar extends Globals { Globals.userinfo_modified = true; // transmit at next oportunity var.string = value; - try { - var.value = Float.parseFloat(var.string); - } catch (Exception e) { - var.value = 0.0f; - } - + var.value = Lib.atof(var.string); var.flags = flags; return var; @@ -196,11 +186,7 @@ public class Cvar extends Globals { var.latched_string = value; } else { var.string = value; - try { - var.value = Float.parseFloat(var.string); - } catch (Exception e) { - var.value = 0.0f; - } + var.value = Lib.atof(var.string); if (var.name.equals("game")) { FS.SetGamedir(var.string); FS.ExecAutoexec(); @@ -325,12 +311,8 @@ public class Cvar extends Globals { cvar_t var = Cvar.FindVar(var_name); if (var == null) return 0; - float val = 0.0f; - try { - val = Float.parseFloat(var.string); - } catch (Exception e) { - } - return val; + + return Lib.atof(var.string); } /** @@ -386,11 +368,7 @@ public class Cvar extends Globals { continue; var.string = var.latched_string; var.latched_string = null; - try { - var.value = Float.parseFloat(var.string); - } catch (NumberFormatException e) { - var.value = 0.0f; - } + var.value = Lib.atof(var.string); if (var.name.equals("game")) { FS.SetGamedir(var.string); FS.ExecAutoexec(); |