From 6b1d055f100ffe98633fcaf7f55205b694269b44 Mon Sep 17 00:00:00 2001 From: Dave Hoover Date: Fri, 15 Oct 2010 20:15:40 +0000 Subject: [PATCH] We were only catching exceptions if we ran outside our piece array. It was still possible to ask and get answers for invalid coordinates as long as the resulting index was kosher. Check for that. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@982 c613c5cb-e716-0410-b11b-feb51c14d237 --- src/java/com/threerings/puzzle/drop/data/DropBoard.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/java/com/threerings/puzzle/drop/data/DropBoard.java b/src/java/com/threerings/puzzle/drop/data/DropBoard.java index 68d18032..f626d829 100644 --- a/src/java/com/threerings/puzzle/drop/data/DropBoard.java +++ b/src/java/com/threerings/puzzle/drop/data/DropBoard.java @@ -129,6 +129,10 @@ public class DropBoard extends Board */ public int getPiece (int col, int row) { + if (!inBounds(col, row)) { + log.warning("Requested piece from invalid coordinate", + "col", col, "row", row, "width", _bwid, "height", _bhei); + } try { return _board[coordsToIndex(col, row)]; } catch (Exception e) {