Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.rotation.forEach((action, actionIndex) => {
let macroFragment = this.macro[this.macro.length - 1];
// One macro is 15 lines, if this one is full, create another one.
// Alternatively, if breaking before Byregots Blessing is enabled, split there too.
if ((this.breakBeforeByregotsBlessing && action.is(ByregotsBlessing)) || macroFragment.length >= this.maxMacroLines) {
this.macro.push(this.macroLock ? ['/mlock'] : []);
macroFragment = this.macro[this.macro.length - 1];
}
if (action.getIds()[0] === -1) {
macroFragment.push(`/statusoff "${this.i18n.getName(this.l12n.getAction(new FinalAppraisal().getIds()[0]))}"`);
totalLength++;
} else {
let actionName = this.i18n.getName(this.l12n.getAction(action.getIds()[0]));
if (actionName.indexOf(' ') > -1 || this.translator.currentLang === 'ko') {
actionName = `"${actionName}"`;
}
macroFragment.push(`/ac ${actionName} `);
totalLength++;
}
let doneWithChunk: boolean;
if (this.breakBeforeByregotsBlessing && actionIndex < this.rotation.length - 1 && this.rotation[actionIndex+1].is(ByregotsBlessing)) {
doneWithChunk = true;
} else if (macroFragment.length === 14 && this.addEcho && this.rotation.length > totalLength + 1) {
doneWithChunk = true;
}