diff --git a/src/java/com/threerings/puzzle/data/TeamPuzzleObject.java b/src/java/com/threerings/puzzle/data/TeamPuzzleObject.java index 1cbb29b52..463905478 100644 --- a/src/java/com/threerings/puzzle/data/TeamPuzzleObject.java +++ b/src/java/com/threerings/puzzle/data/TeamPuzzleObject.java @@ -91,7 +91,7 @@ public class TeamPuzzleObject extends PuzzleObject // if this is a valid target and tcount is zero, stop; note // that we rely on the short-circuit to only decrement tcount // when we're on a valid target - if (isValidTarget(pidx, tpidx) && (tcount-- == 0)) { + if (isRandomValidTarget(pidx, tpidx) && (tcount-- == 0)) { return tpidx; } tpidx++; @@ -112,7 +112,7 @@ public class TeamPuzzleObject extends PuzzleObject { int count = 0; for (int ii = 0; ii < players.length; ii++) { - if (isValidTarget(pidx, ii)) { + if (isRandomValidTarget(pidx, ii)) { count++; } } @@ -132,6 +132,19 @@ public class TeamPuzzleObject extends PuzzleObject pidx != tpidx && isActivePlayer(tpidx) && teams[pidx] != teams[tpidx]); } + + /** + * Returns whether one player may target another player on random + * reassignment. + * + * @param pidx the player index of the player attempting to change + * their target player. + * @param tpidx the player index of the player being targeted. + */ + protected boolean isRandomValidTarget (int pidx, int tpidx) + { + return isValidTarget(pidx, tpidx); + } // AUTO-GENERATED: METHODS START /**