diff --git a/src/components/designer/MacroImporter.vue b/src/components/designer/MacroImporter.vue index c8d9c8a0..af8741ba 100644 --- a/src/components/designer/MacroImporter.vue +++ b/src/components/designer/MacroImporter.vue @@ -60,21 +60,15 @@ function confirm() { } else { result = input .split(/\/[^\s]+||\n/) - .flatMap(v => { - if (v.length == 0) { - return []; - } - v = v.trim() - // remove quotation + .map(v => v.trim()) + .filter(v => v.length > 0) + .map(v => { if (v.charAt(0) == '"' && v.charAt(v.length - 1) == '"') { v = v.substring(1, v.length - 1); } - const action = namesToAction.get(v); - if (action == undefined) { - return []; - } - return [action] - }); + return namesToAction.get(v); + }) + .filter(v => v != undefined); if (result.length == 0) { ElMessage({ type: 'warning', diff --git a/src/libs/Craft.ts b/src/libs/Craft.ts index 827fb288..c528c407 100644 --- a/src/libs/Craft.ts +++ b/src/libs/Craft.ts @@ -226,7 +226,10 @@ const waitTimes = new Map([ [Actions.TrainedPerfection, 3], ]) -const postCastDelay = new Map(waitTimes.entries().map(x => [x[0], x[1] - 0.5])) +const postCastDelay = new Map() +for (const [action, time] of waitTimes.entries()) { + postCastDelay.set(action, time + 0.5) +} export const newRecipe = async ( rlv: number,