Better error reporting.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3437 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2005-03-29 23:18:00 +00:00
parent a62f9621b2
commit d60445e16b
@@ -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 // Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved // 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) { public boolean addObject (ObjectInfo info) {
// sanity check: see if there is already an object of this // sanity check: see if there is already an object of this
// type at these coordinates // type at these coordinates
if (ListUtil.indexOf(objectInfo, info) != -1 || int dupidx;
indexOfUn(info) != -1) { if ((dupidx = ListUtil.indexOf(objectInfo, info)) != -1) {
Log.warning("Refusing to add duplicate interesting " + Log.warning("Refusing to add duplicate object [ninfo=" + info +
"object " + info + "."); ", oinfo=" + objectInfo[dupidx] + "].");
return false;
}
if ((dupidx = indexOfUn(info)) != -1) {
Log.warning("Refusing to add duplicate object " +
"[info=" + info + "].");
return false; return false;
} }