cozuya / secret-hitler

A web adaptation of the social deduction board game Secret Hitler. https://secrethitler.io
Other
814 stars 203 forks source link

Players with 10 entries on their blacklist can't remove any of them. #936

Closed cozuya closed 5 years ago

cozuya commented 5 years ago

anyone have details on this one? otherwise I can figure it out.

andy013 commented 5 years ago

Change line 1535 in user-events.js from (account.gameSettings.blacklist && account.gameSettings.blacklist.length < 10) ||

to

(setting === 'blacklist' && data[setting].length <= 10) ||

You were checking the users current blacklist rather than checking the updated blacklist they were sending. That new line checks the updated blacklist they are sending and accepts it if they are removing a player but not if they are adding one.