X-Git-Url: https://git.cworth.org/git?p=empires-server;a=blobdiff_plain;f=empathy.js;h=7b1e9a1a7e79815a4d6c581f22562056bbb27f04;hp=50d18d59dce942115f19d5852df191c49ae601d3;hb=fd6875ac5df6262460bcca803aae3b223c18eca4;hpb=8e236d4023f974dbe5e9ed0c9c8796134b33e046 diff --git a/empathy.js b/empathy.js index 50d18d5..7b1e9a1 100644 --- a/empathy.js +++ b/empathy.js @@ -598,10 +598,14 @@ class Prompt { } toggle_vote_against(player_name) { - if (this.votes_against.find(v => v === player_name)) + if (this.votes_against.find(v => v === player_name)) { this.votes_against = this.votes_against.filter(v => v !== player_name); - else + } else { this.votes_against.push(player_name); + /* When voting against, we also remove any vote _for_ the same + * prompt. */ + this.votes = this.votes.filter(v => v !== player_name); + } } }