mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 07:47:50 +01:00
allow games to be created with no initial cards
This commit is contained in:
@@ -27,7 +27,9 @@ class Game {
|
||||
this.previousModeratorId = null;
|
||||
this.createTime = createTime;
|
||||
this.timerParams = timerParams;
|
||||
this.isStartable = (this.gameSize === 1 && !this.hasDedicatedModerator) || isTestGame;
|
||||
this.isStartable = (this.gameSize === 1 && !this.hasDedicatedModerator)
|
||||
|| (this.gameSize === 0 && this.hasDedicatedModerator)
|
||||
|| isTestGame;
|
||||
this.timeRemaining = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class GameCreationRequest {
|
||||
};
|
||||
|
||||
static deckIsValid = (deck) => {
|
||||
if (Array.isArray(deck) && deck.length > 0) {
|
||||
if (Array.isArray(deck)) {
|
||||
for (const entry of deck) {
|
||||
if (entry !== null
|
||||
&& typeof entry === 'object'
|
||||
@@ -45,7 +45,7 @@ class GameCreationRequest {
|
||||
&& entry.description.length <= globals.MAX_CUSTOM_ROLE_DESCRIPTION_LENGTH
|
||||
&& (!entry.custom || typeof entry.custom === 'boolean')
|
||||
&& typeof entry.quantity === 'number'
|
||||
&& entry.quantity >= 1
|
||||
&& entry.quantity >= 0
|
||||
&& entry.quantity <= 50
|
||||
) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user