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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user