From 3f386fbeec0ce9a0fd3d78e81d7bb6ac92a4e4e6 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Mon, 4 Dec 2017 21:02:50 -0600 Subject: [PATCH] Support Mod rules in tournaments --- rooms.js | 2 -- tournaments/index.js | 3 +-- users.js | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/rooms.js b/rooms.js index b6156e2ece..dcb64685e3 100644 --- a/rooms.js +++ b/rooms.js @@ -1666,8 +1666,6 @@ let Rooms = Object.assign(getRoom, { } const roomid = Rooms.global.prepBattleRoom(formatid); - const format = Dex.getFormat(formatid); - formatid = format.id; options.format = formatid; // options.rated is a number representing the lower player rating, for searching purposes // options.rated < 0 or falsy means "unrated", and will be converted to 0 here diff --git a/tournaments/index.js b/tournaments/index.js index f3ace65442..2390b361fd 100644 --- a/tournaments/index.js +++ b/tournaments/index.js @@ -116,8 +116,7 @@ class Tournament { setCustomRules(rules, output) { let format = Dex.getFormat(this.originalFormat); if (format.team) { - output.errorReply(format.name + " does not support custom rules."); - return false; + output.errorReply(`WARNING: ${format.name} uses generated teams - only in-battle mod rules (like Sleep Clause Mod) will have any effect.`); } format = Dex.getFormat(this.originalFormat, rules); if (!format.customRules) { diff --git a/users.js b/users.js index 63f6272dcf..d12afa3094 100644 --- a/users.js +++ b/users.js @@ -1330,7 +1330,7 @@ class User { time: time, from: this.userid, to: user.userid, - format: '' + (format || ''), + format: toId(format), //isPrivate: !!isPrivate, // currently unused team: team, };