Support Mod rules in tournaments

This commit is contained in:
Guangcong Luo 2017-12-04 21:02:50 -06:00
parent 08d079037d
commit 3f386fbeec
3 changed files with 2 additions and 5 deletions

View File

@ -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

View File

@ -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) {

View File

@ -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,
};