- const idxInVariants = variantArray.findIndex(v => v.id == c.vid);
- const vname = variantArray[idxInVariants].name;
- const scriptId = vname + "RulesScript";
- const afterRulesAreLoaded = () => {
- const V = eval(vname + "Rules");
- // Allow custom FEN (and check it) only for individual challenges
- if (c.fen.length > 0 && playerCount > 0)
- {
- if (!V.IsGoodFen(c.fen))
- return "Bad FEN string";
- }
- else
- {
- // Generate a FEN
- c.fen = V.GenRandInitFen();
- }
- };
- if (!document.getElementById(scriptId))
+ const V = eval(vname + "Rules");
+ // Allow custom FEN (and check it) only for individual challenges
+ if (c.fen.length > 0 && playerCount > 0)