Turn under control reworked:

- game: fixed game freezes when computer try to take control over another computer or human (added game logs, related to #12878);
 - cheats: improved take and give control commands, now you can give control under yourself to another player;
 - cheats: improved take and give control commands, now you can return control to computer in the same priority;
 - cheats: deleted useless and unused command to activate opponent's ability;
This commit is contained in:
Oleg Agafonov 2025-01-11 22:21:58 +04:00
parent a5c354f960
commit 1f1d1088a1
6 changed files with 50 additions and 73 deletions

View file

@ -360,9 +360,14 @@ public class HumanPlayer extends PlayerImpl {
// async command: cheat by current player
if (response.getAsyncWantCheat()) {
// execute cheats and continue
// run cheats
SystemUtil.executeCheatCommands(game, null, this);
game.fireUpdatePlayersEvent(); // need force to game update for new possible data
// force to game update for new possible data
game.fireUpdatePlayersEvent();
// must stop current dialog on changed control, so game can give priority to actual player
if (this.isGameUnderControl() != game.getPlayer(this.getId()).isGameUnderControl()) {
return;
}
// wait another answer
if (canRespond()) {
loop = true;