Fix hand hiding after controlled turns

This commit is contained in:
Bug Hunter
2020-12-25 09:46:01 +00:00
committed by Hans Mackowiak
parent 63b5eac6b9
commit e0688d7458
3 changed files with 8 additions and 4 deletions

View File

@@ -439,10 +439,10 @@ public class Game {
}
public synchronized void setGameOver(GameEndReason reason) {
age = GameStage.GameOver;
for (Player p : allPlayers) {
p.clearController();
}
age = GameStage.GameOver;
for (Player p : getPlayers()) {
p.onGameOver();

View File

@@ -2574,6 +2574,8 @@ public class Player extends GameEntity implements Comparable<Player> {
final PlayerController oldController = getController();
controlledBy.remove(timestamp);
getView().updateMindSlaveMaster(this);
if (event) {
game.fireEvent(new GameEventPlayerControl(this, oldLobbyPlayer, oldController, getLobbyPlayer(), getController()));
}
@@ -2581,9 +2583,9 @@ public class Player extends GameEntity implements Comparable<Player> {
public void clearController() {
controlledBy.clear();
game.fireEvent(new GameEventPlayerControl(this, null, null, getLobbyPlayer(), getController()));
}
public Map.Entry<Long, Player> getControlledWhileSearching() {
if (controlledWhileSearching.isEmpty()) {
return null;

View File

@@ -793,9 +793,11 @@ public final class CMatchUI
initHandViews();
SLayoutIO.loadLayout(null);
view.populate();
for (final VHand h : getHandViews()) {
h.getLayoutControl().updateHand();
final PlayerZoneUpdates zones = new PlayerZoneUpdates();
for (final PlayerView p : sortedPlayers) {
zones.add(new PlayerZoneUpdate(p, ZoneType.Hand));
}
updateZones(zones);
}
@Override