From eae92d8d89d45d430cdc64a27d236576c6f711dc Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 9 Jun 2005 22:00:57 +0000 Subject: [PATCH] StartAction was never getting called for watchers, so the player index was not set up correctly. Rather than trying to save the player index somewhere or have a new method for retrieving it (and knowing if it changes), just let the PuzzleController worry about all that and simply always ask it for the index. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3592 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../drop/client/DropControllerDelegate.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/java/com/threerings/puzzle/drop/client/DropControllerDelegate.java b/src/java/com/threerings/puzzle/drop/client/DropControllerDelegate.java index b25bc7c20..0a183bf45 100644 --- a/src/java/com/threerings/puzzle/drop/client/DropControllerDelegate.java +++ b/src/java/com/threerings/puzzle/drop/client/DropControllerDelegate.java @@ -175,9 +175,6 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate // Log.info("Starting drop action"); - // save off the player index - _pidx = _ctrl.getPlayerIndex(); - // add ourselves as a frame participant _ctx.getFrameManager().registerFrameParticipant(this); @@ -455,8 +452,8 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate return; } - if (_pidx != -1 && !_ctrl.isGameOver() && - _puzobj.isActivePlayer(_pidx)) { + int pidx = _ctrl.getPlayerIndex(); + if (pidx != -1 && !_ctrl.isGameOver() && _puzobj.isActivePlayer(pidx)) { // create the next block _blocksprite = createNextBlock(); if (_blocksprite != null) { @@ -621,11 +618,12 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate */ protected void updateSelfSummary () { - if (_pidx != -1 && _puzobj != null && _puzobj.summaries != null) { - BoardSummary bsum = _puzobj.summaries[_pidx]; + int pidx = _ctrl.getPlayerIndex(); + if (pidx != -1 && _puzobj != null && _puzobj.summaries != null) { + BoardSummary bsum = _puzobj.summaries[pidx]; bsum.setBoard(_dboard); bsum.summarize(); - _dpanel.setSummary(_pidx, bsum); + _dpanel.setSummary(pidx, bsum); } } @@ -1132,9 +1130,6 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate /** The board dimensions in pieces. */ protected int _bwid, _bhei; - /** Our player index in the game. */ - protected int _pidx; - /** The distance the board row travels in pixels. */ protected int _risedist;