Skip to content

Commit

Permalink
fix: Fix some glitch on resource pack & save detection
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed Jan 4, 2025
1 parent 196b266 commit f322d62
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion xmcl-keystone-ui/src/composables/instanceOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export function useInstanceOptions(instancePath: Ref<string>) {
editGameSetting({
instancePath: instancePath.value,
lang: locale.value.toLowerCase().replace('-', '_'),
resourcePacks: newOps.resourcePacks,
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion xmcl-runtime/instance/InstanceOptionsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class InstanceOptionsService extends AbstractService implements IInstance
loadOptions(path)
} else if (basename(file) === ('optionsshaders.txt')) {
loadShaderOptions(path)
} else if (event === 'unlinkDir' && file === path) {
} else if (event === 'unlinkDir' && !file) {
dispose()
}
}).add('options.txt')
Expand Down
3 changes: 3 additions & 0 deletions xmcl-runtime/resourcePack/AbstractInstanceDoaminService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ export abstract class AbstractInstanceDomainService extends AbstractService {
throw e
})
if (fstat.isDirectory()) continue
const dstat = await stat(dest).catch(_ => undefined)
if (dstat?.ino === fstat.ino) continue
if (dstat?.size === fstat.size) continue
result.push(await linkOrCopyFile(src, dest))
}
return result
Expand Down
2 changes: 1 addition & 1 deletion xmcl-runtime/save/InstanceSavesService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export class InstanceSavesService extends AbstractService implements IInstanceSa
path: absPath,
})
}
} else if (event === 'unlinkDir' && file === path) {
} else if (event === 'unlinkDir' && (file === path || !file)) {
dispose()
}
})
Expand Down

0 comments on commit f322d62

Please sign in to comment.