diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-12-24 00:42:11 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-12-24 00:42:11 +0100 |
commit | d6a4cd962b91cd574d7f17193416e1fdd3fcf1b7 (patch) | |
tree | 8d51ad0397baea71fcb6815d1f2f7007f953f828 | |
parent | e67206db362bc6a1642aaf2317dee49fe0bd184b (diff) | |
download | wilderness-war-d6a4cd962b91cd574d7f17193416e1fdd3fcf1b7.tar.gz |
Automatic resign menu.
-rw-r--r-- | play.html | 2 | ||||
-rw-r--r-- | rules.js | 14 |
2 files changed, 4 insertions, 12 deletions
@@ -51,8 +51,6 @@ <li><a href="info/charts.html" target="_blank">Charts & Tables</a> <li><a href="info/cards.html" target="_blank">Cards</a> <li><a href="info/pieces.html" target="_blank">Leaders & Units</a> - <li class="resign separator"> - <li class="resign" onclick="confirm_resign()">Resign </menu> </details> <details id="stack_menu"> @@ -9698,14 +9698,6 @@ function load_game_state(state) { update_active_aliases() } -exports.resign = function (state, current) { - load_game_state(state) - delete game.retro_foul_weather - if (game.state !== 'game_over') - goto_game_over(current === FRANCE ? BRITAIN : FRANCE, current + " resigned.") - return game -} - exports.action = function (state, current, action, arg) { load_game_state(state) if (action in states[game.state]) @@ -9750,8 +9742,10 @@ function inactive_prompt(name, who, where) { exports.view = function(state, current) { load_game_state(state) - if (game.retro_foul_weather && game.state !== 'foul_weather' && current !== game.active) { - load_game_state(game.retro_foul_weather) + if (game.state !== "game_over") { + if (game.retro_foul_weather && game.state !== 'foul_weather' && current !== game.active) { + load_game_state(game.retro_foul_weather) + } } view = { |