From ef8aef2d2a7d9d644bb415e0baf7a2dba124bbbe Mon Sep 17 00:00:00 2001 From: nicfreeman1209 Date: Tue, 11 May 2021 12:45:13 +0100 Subject: [PATCH] don't update nomination state from revealed grimoire --- src/store/index.js | 17 +++++++++-------- src/store/socket.js | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index a5ee9a8..79d579b 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -307,16 +307,17 @@ export default new Vuex.Store({ } }); if (!isLightweight) { - // properties we always update this.commit("toggleNight", !!isNight); this.commit("session/setVoteHistoryAllowed", isVoteHistoryAllowed); - this.commit("session/nomination", { - nomination, - votes, - votingSpeed, - lockedVote, - isVoteInProgress - }); + if (nomination !== -1) { + this.commit("session/nomination", { + nomination, + votes, + votingSpeed, + lockedVote, + isVoteInProgress + }); + } this.commit("session/setMarkedPlayer", markedPlayer); this.commit("players/setFabled", { fabled: fabled.map(f => state.fabled.get(f.id) || f) diff --git a/src/store/socket.js b/src/store/socket.js index d6bc3b2..8b0994d 100644 --- a/src/store/socket.js +++ b/src/store/socket.js @@ -248,7 +248,7 @@ class LiveSession { } /** - * Publish the current game state. + * Publish the current game state, as seen by a player * Optional param isLightweight to reduce traffic (=send only player data) * Optional param isRevealGrimoire to reveal grimoire (=include ALL player roles, reminders & bluffs) * @param playerId @@ -294,7 +294,7 @@ class LiveSession { isRevealedGrimoire: isRevealedGrimoire, isNight: grimoire.isNight, isVoteHistoryAllowed: session.isVoteHistoryAllowed, - nomination: session.nomination, + nomination: isRevealedGrimoire ? -1 : session.nomination, votingSpeed: session.votingSpeed, lockedVote: session.lockedVote, isVoteInProgress: session.isVoteInProgress,