Fix error if try to play victory point too early
Block sending blank chat messages Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
parent
47e11dff69
commit
eb39a175df
@ -2363,8 +2363,7 @@ const playCard = (game, session, card) => {
|
||||
}
|
||||
});
|
||||
if (points < getVictoryPointRule(game)) {
|
||||
return `You can not play victory point cards until you can reach `
|
||||
`${getVictoryPointRule(game) }!`;
|
||||
return `You can not play victory point cards until you can reach ${getVictoryPointRule(game)}!`;
|
||||
}
|
||||
addChatMessage(game, session, `${name} played a Victory Point card.`);
|
||||
}
|
||||
@ -4109,7 +4108,11 @@ router.ws("/ws/:id", async (ws, req) => {
|
||||
break;
|
||||
|
||||
case 'chat':
|
||||
console.log(`${short}:${id} - ${data.type} - ${data.message}`)
|
||||
/* If the chat message is empty, do not add it to the chat */
|
||||
if (data.message.trim() == '') {
|
||||
break;
|
||||
}
|
||||
console.log(`${short}:${id} - ${data.type} - "${data.message}"`)
|
||||
addChatMessage(game, session, `${session.name}: ${data.message}`, true);
|
||||
parseChatCommands(game, data.message);
|
||||
sendUpdateToPlayers(game, { chat: game.chat });
|
||||
|
Loading…
x
Reference in New Issue
Block a user