parent
32b1e355a4
commit
a17028c651
@ -63,6 +63,7 @@ function updateGameState(gameState) {
|
||||
const username = document.getElementById('username').value;
|
||||
const submitButton = document.getElementById('submitMove');
|
||||
const targetSelector = document.getElementById('targetPlayer');
|
||||
const currentTarget = targetSelector.value; // Сохраняем текущий выбор цели
|
||||
|
||||
if (gameState.battle_end) {
|
||||
const winnerDiv = document.createElement('div');
|
||||
@ -84,6 +85,11 @@ function updateGameState(gameState) {
|
||||
targetSelector.appendChild(option);
|
||||
}
|
||||
});
|
||||
|
||||
// Восстанавливаем текущий выбор цели, если он существует в новом списке
|
||||
if (aliveFighters.some(fighter => fighter.name === currentTarget)) {
|
||||
targetSelector.value = currentTarget;
|
||||
}
|
||||
} else {
|
||||
targetSelector.style.display = 'none';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user