From d60445e16b2d50e3590c39ca9cb8296d50e3ef8a Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 29 Mar 2005 23:18:00 +0000 Subject: [PATCH] Better error reporting. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3437 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../miso/data/SparseMisoSceneModel.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/java/com/threerings/miso/data/SparseMisoSceneModel.java b/src/java/com/threerings/miso/data/SparseMisoSceneModel.java index a445b7ac8..d605d6d81 100644 --- a/src/java/com/threerings/miso/data/SparseMisoSceneModel.java +++ b/src/java/com/threerings/miso/data/SparseMisoSceneModel.java @@ -1,5 +1,5 @@ // -// $Id: SparseMisoSceneModel.java,v 1.17 2004/10/23 17:36:32 mdb Exp $ +// $Id$ // // Narya library - tools for developing networked games // Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved @@ -118,10 +118,15 @@ public class SparseMisoSceneModel extends MisoSceneModel public boolean addObject (ObjectInfo info) { // sanity check: see if there is already an object of this // type at these coordinates - if (ListUtil.indexOf(objectInfo, info) != -1 || - indexOfUn(info) != -1) { - Log.warning("Refusing to add duplicate interesting " + - "object " + info + "."); + int dupidx; + if ((dupidx = ListUtil.indexOf(objectInfo, info)) != -1) { + Log.warning("Refusing to add duplicate object [ninfo=" + info + + ", oinfo=" + objectInfo[dupidx] + "]."); + return false; + } + if ((dupidx = indexOfUn(info)) != -1) { + Log.warning("Refusing to add duplicate object " + + "[info=" + info + "]."); return false; }