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) { public synchronized void setGameOver(GameEndReason reason) {
age = GameStage.GameOver;
for (Player p : allPlayers) { for (Player p : allPlayers) {
p.clearController(); p.clearController();
} }
age = GameStage.GameOver;
for (Player p : getPlayers()) { for (Player p : getPlayers()) {
p.onGameOver(); p.onGameOver();

View File

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

View File

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