From 8dbef59cd73b2e60ce21ff1e57919154d6828f7b Mon Sep 17 00:00:00 2001
From: cheese-testing <64868904+cheese-testing@users.noreply.github.com>
Date: Sun, 24 May 2020 12:42:35 -0700
Subject: [PATCH] Scavenger games: Allow finishers to continue and announce
correctly
---
server/chat-plugins/scavenger-games.ts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/server/chat-plugins/scavenger-games.ts b/server/chat-plugins/scavenger-games.ts
index 111c772ded..91793a7073 100644
--- a/server/chat-plugins/scavenger-games.ts
+++ b/server/chat-plugins/scavenger-games.ts
@@ -221,7 +221,7 @@ const MODES: {[k: string]: GameMode | string} = {
onJoin(user: User) {
const game = this.room.scavgame!;
- if (game.playerlist && game.playerlist.includes(user.id)) {
+ if (game.playerlist && !game.playerlist.includes(user.id)) {
user.sendTo(this.room, 'You are not allowed to join this scavenger hunt.');
return true;
}
@@ -230,7 +230,7 @@ const MODES: {[k: string]: GameMode | string} = {
onAfterEnd() {
const game = this.room.scavgame!;
if (!this.completed.length) {
- this.announce('No one has completd the hunt - the round has been void.');
+ this.announce('No one has completed the hunt - the round has been void.');
return;
}
@@ -239,7 +239,7 @@ const MODES: {[k: string]: GameMode | string} = {
// elimination
if (!game.playerlist) {
game.playerlist = this.completed.map(entry => toID(entry.name));
- this.announce(`Round ${game.round} - ${Chat.toListString(this.players.map(p => `${p.name}`))} have successfully completed the last hunt and have moved on to the next round!`);
+ this.announce(`Round ${game.round} - ${Chat.toListString(this.completed.map(p => `${p.name}`))} have successfully completed the last hunt and have moved on to the next round!`);
} else {
let eliminated = [];
const completed = this.completed.map(entry => toID(entry.name)) as string[];