Guard browser shared tool-table result helper

This commit is contained in:
2026-06-14 07:03:10 +08:00
parent 29ee314afb
commit c260246a8e
2 changed files with 57 additions and 2 deletions

View File

@@ -4619,11 +4619,15 @@
];
}
function toolTableResultLines(tools) {
return tools.flatMap((tool) => tool.resultLines);
}
function directToolTableResultLines(operation, tools, extraLines = []) {
return [
`tooldata_${operation}=0`,
...extraLines,
...tools.flatMap((tool) => tool.resultLines),
...toolTableResultLines(tools),
];
}
@@ -4644,7 +4648,7 @@
return [
...(operation === "load" ? ["tooldata_random_toolchanger=1"] : []),
`tooldata_${operation}=0`,
...tools.flatMap((tool) => tool.resultLines),
...toolTableResultLines(tools),
];
}