diff options
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -829,11 +829,18 @@ function check_victory() { return goto_game_over("Draw", player_name(1) + " secured a draw!") } - if (info.players[0].tactical > 0 && tv0 >= info.players[0].tactical) - return goto_game_over(P1, player_name(0) + " won a tactical victory!") - - if (info.players[1].tactical > 0 && tv1 >= info.players[1].tactical) - return goto_game_over(P2, player_name(1) + " won a tactical victory!") + // Active player gets precedence when both TV conditions apply + if (game.active === P1) { + if (info.players[0].tactical > 0 && tv0 >= info.players[0].tactical) + return goto_game_over(P1, player_name(0) + " won a tactical victory!") + if (info.players[1].tactical > 0 && tv1 >= info.players[1].tactical) + return goto_game_over(P2, player_name(1) + " won a tactical victory!") + } else { + if (info.players[1].tactical > 0 && tv1 >= info.players[1].tactical) + return goto_game_over(P2, player_name(1) + " won a tactical victory!") + if (info.players[0].tactical > 0 && tv0 >= info.players[0].tactical) + return goto_game_over(P1, player_name(0) + " won a tactical victory!") + } return false } |