Fix suspect test ladders

We deployed a new suspect test system a few months ago, but we had to
back out of it when it didn't work as expected. This fixes the bug that
made it not work. In the future, setting `rated: "[Gen 8] Format Name"`
in `formats.ts` will cause ladder games in that format to actually
go in the specified format's ladder, instead of its own.
This commit is contained in:
Guangcong Luo 2020-09-27 08:37:50 -07:00
parent 6cb31fe2a6
commit d429d58bc6

View File

@ -261,7 +261,7 @@ export class Format extends BasicEffect implements Readonly<BasicEffect & Format
* (Challenge and tournament games will never update ladder points.)
* (Defaults to `true`.)
*/
readonly rated: boolean;
readonly rated: boolean | string;
/** Game type. */
readonly gameType: GameType;
/** List of rule names. */
@ -328,7 +328,7 @@ export class Format extends BasicEffect implements Readonly<BasicEffect & Format
this.mod = Utils.getString(data.mod) || 'gen8';
this.effectType = Utils.getString(data.effectType) as FormatEffectType || 'Format';
this.debug = !!data.debug;
this.rated = (data.rated !== false);
this.rated = (typeof data.rated === 'string' ? data.rated : data.rated !== false);
this.gameType = data.gameType || 'singles';
this.ruleset = data.ruleset || [];
this.baseRuleset = data.baseRuleset || [];