From 4623c07fc265d49ab6463c558ff5e6c398b8ec99 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Wed, 12 Jun 2002 23:30:40 +0000 Subject: [PATCH] Undid revisions 1.16 and 1.15: null tiles and invalid coordinates are unpassable again. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1453 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/miso/client/util/AStarPathUtil.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/java/com/threerings/miso/client/util/AStarPathUtil.java b/src/java/com/threerings/miso/client/util/AStarPathUtil.java index ac0f17e53..a9df6df6a 100644 --- a/src/java/com/threerings/miso/client/util/AStarPathUtil.java +++ b/src/java/com/threerings/miso/client/util/AStarPathUtil.java @@ -1,5 +1,5 @@ // -// $Id: AStarPathUtil.java,v 1.17 2002/06/12 21:51:19 ray Exp $ +// $Id: AStarPathUtil.java,v 1.18 2002/06/12 23:30:40 ray Exp $ package com.threerings.miso.scene.util; @@ -190,9 +190,9 @@ public class AStarPathUtil { if (isCoordinateValid(info, x, y)) { BaseTile tile = info.scene.getBaseTile(x, y); - return (tile == null) || info.trav.canTraverse(tile); + return (tile != null) && info.trav.canTraverse(tile); } - return true; + return false; } /** @@ -222,12 +222,6 @@ public class AStarPathUtil */ protected static AStarNode getNode (AStarInfo info, int x, int y) { - // deal gracefully if we were asked to create a node offscreen - if ((x < 0) || (x >= info.nodes.length) || - (y < 0) || (y >= info.nodes[x].length)) { - return new AStarNode(x, y); // fake the funk - } - AStarNode n = info.nodes[x][y]; return (n == null) ? (info.nodes[x][y] = new AStarNode(x, y)) : n; }