Cleaned up some bits that assumed that _pidx was always > 0.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3576 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2005-05-24 23:30:59 +00:00
parent 919790557f
commit ccbd38f255
2 changed files with 4 additions and 3 deletions
@@ -400,7 +400,7 @@ public abstract class PuzzleController extends GameController
}
// refuse to start the action if our puzzle view is hidden
if (!_panel.getBoardView().isShowing()) {
if (_pidx != -1 && !_panel.getBoardView().isShowing()) {
Log.warning("Refusing to start action on hidden puzzle.");
Thread.dumpStack();
return;
@@ -455,7 +455,8 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate
return;
}
if (!_ctrl.isGameOver() && _puzobj.isActivePlayer(_pidx)) {
if (_pidx != -1 && !_ctrl.isGameOver() &&
_puzobj.isActivePlayer(_pidx)) {
// create the next block
_blocksprite = createNextBlock();
if (_blocksprite != null) {
@@ -620,7 +621,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate
*/
protected void updateSelfSummary ()
{
if (_puzobj != null && _puzobj.summaries != null) {
if (_pidx != -1 && _puzobj != null && _puzobj.summaries != null) {
BoardSummary bsum = _puzobj.summaries[_pidx];
bsum.setBoard(_dboard);
bsum.summarize();