|
@@ -244,7 +244,8 @@ public class JDGDRoom extends Room implements GRoomInterface {
|
|
|
if (this.data.maxNum >= 4) {
|
|
|
Integer[] nextPos = this.getNextPos(player.data.pos);
|
|
|
Player tmpPlayer = this.data.playerMap.get(nextPos[1]);
|
|
|
- player.data.teammateId = tmpPlayer != null ? tmpPlayer.data.teammateId : null;
|
|
|
+// player.data.teammateId = tmpPlayer != null ? tmpPlayer.data.teammateId : null;
|
|
|
+ player.data.teammateId = tmpPlayer.getId();
|
|
|
}
|
|
|
// 发牌
|
|
|
for (int i = 0; i < 27; i++) {
|
|
@@ -372,6 +373,21 @@ public class JDGDRoom extends Room implements GRoomInterface {
|
|
|
return nextPlayer;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取当前未出完牌玩家数量
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public int getCanOpPlayer() {
|
|
|
+ int cnt = 0;
|
|
|
+ for (Player temPlayer : this.data.playerMap.values()) {
|
|
|
+ if (temPlayer != null && temPlayer.data.state == 2) {
|
|
|
+ cnt += 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return cnt;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 判断玩家出的牌是否可以压过上一手牌
|
|
|
*
|
|
@@ -496,7 +512,7 @@ public class JDGDRoom extends Room implements GRoomInterface {
|
|
|
// 添加过玩家列表
|
|
|
this.data.passList.add(player.getId());
|
|
|
// 4人房3人不出,清空出牌堆
|
|
|
- if (this.data.passList.size() >= this.data.maxNum - 1) {
|
|
|
+ if (this.data.passList.size() >= this.getCanOpPlayer() - 1) {
|
|
|
this.data.curDisCardList = new int[0];
|
|
|
this.data.curDisCardType = null;
|
|
|
this.data.passList.clear();
|