mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-18 21:44:30 +08:00
fix: 多个 id 共用一个偏移导致画不出来
This commit is contained in:
1 parent
1c27014ab3
commit
15f5282d8c
1 file changed
+3
-2
@@ -9,9 +9,10 @@ function extractClsBlocks<C extends Exclude<Cls, 'tileset'>>(
|
||||
icons: Record<string, number>
|
||||
): IBlockIdentifier[] {
|
||||
const max = Math.max(...Object.values(icons));
|
||||
const arr = Array(max).fill(0);
|
||||
const arr = Array(max).fill(void 0);
|
||||
for (const [key, value] of Object.entries(icons)) {
|
||||
if (!(key in map)) continue;
|
||||
// 样板编辑器 bug 可能会导致多个 id 使用一个偏移,因此要判断下
|
||||
if (!(key in map) || !isNil(arr[value])) continue;
|
||||
const id = key as AllIdsOf<C>;
|
||||
const num = map[id] as keyof NumberToId;
|
||||
const identifier: IBlockIdentifier = {
|
||||
|
||||
Reference in new issue
Block a user