From e39c6f05a296e872b4b4dd024913c67dfdc9c19f Mon Sep 17 00:00:00 2001 From: Carsten Weisse Date: Sun, 23 Jan 2005 20:04:06 +0000 Subject: now it works without null and handles empty strings correctly --- src/jake2/client/SCR.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/jake2/client') diff --git a/src/jake2/client/SCR.java b/src/jake2/client/SCR.java index 9e263a1..7e27e3e 100644 --- a/src/jake2/client/SCR.java +++ b/src/jake2/client/SCR.java @@ -2,7 +2,7 @@ * SCR.java * Copyright (C) 2003 * - * $Id: SCR.java,v 1.11 2005-01-23 19:16:17 cawe Exp $ + * $Id: SCR.java,v 1.12 2005-01-23 20:04:06 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -896,7 +896,8 @@ public final class SCR extends Globals { Com.ParseHelp ph = new Com.ParseHelp(s); - while ((token = Com.Parse(ph)) != null) { + while (!ph.isEof()) { + token = Com.Parse(ph); if (token.equals("xl")) { token = Com.Parse(ph); x = Lib.atoi(token); @@ -1127,7 +1128,7 @@ public final class SCR extends Globals { value = cl.frame.playerstate.stats[Lib.atoi(token)]; if (value == 0) { // skip to endif - while ((token = Com.Parse(ph)) != null && !token.equals("endif")); + while (!ph.isEof() && !(token = Com.Parse(ph)).equals("endif")); } continue; } -- cgit v1.2.3