-
Notifications
You must be signed in to change notification settings - Fork 8
games: Stop sending pages to players who forfeited #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
d85c6e2
bb68582
62fa7e3
9b6743e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,11 +26,12 @@ export function interfaceHandler(message: PSMessage) { | |
| if (!game) return; // Don't put any errors here! People should be able to close games that don't exist, like ones that ended | ||
|
|
||
| const user = message.author.id; | ||
| if (game.hasPlayer(user)) { | ||
| const player = Object.values(game.players).find(p => p.id === user); | ||
| if (game.hasPlayer(user) && player && !player.out) { | ||
| message.reply(game.$T('GAME.CANNOT_LEAVE', { prefix, game: game.meta.id })); | ||
| return game.update(user); | ||
| } | ||
| if (game.spectators.includes(user)) { | ||
| if (game.spectators.includes(user) || (player && player.out)) { | ||
|
||
| game.spectators.remove(user); | ||
| message.reply( | ||
| game.$T('GAME.NO_LONGER_WATCHING', { | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.