mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 16:14:48 +01:00
fix metadata restoration
This commit is contained in:
@@ -65,6 +65,8 @@ class App extends React.Component<IProps, IState> {
|
|||||||
listen('game_closed', async () => {
|
listen('game_closed', async () => {
|
||||||
const unpatched = await unpatchGame()
|
const unpatched = await unpatchGame()
|
||||||
|
|
||||||
|
console.log(`unpatched game? ${unpatched}`)
|
||||||
|
|
||||||
if (!unpatched) {
|
if (!unpatched) {
|
||||||
alert(`Could not unpatch game! (You should be able to find your metadata backup in ${await dataDir()}\\cultivation\\)`)
|
alert(`Could not unpatch game! (You should be able to find your metadata backup in ${await dataDir()}\\cultivation\\)`)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ export async function patchGame() {
|
|||||||
|
|
||||||
export async function unpatchGame() {
|
export async function unpatchGame() {
|
||||||
const backupExists = await invoke('dir_exists', {
|
const backupExists = await invoke('dir_exists', {
|
||||||
path: getBackupMetadataPath + '\\global-metadata-unpatched.dat'
|
path: await getBackupMetadataPath() + '\\global-metadata-unpatched.dat'
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!backupExists) {
|
if (!backupExists) {
|
||||||
@@ -158,7 +158,7 @@ export async function unpatchGame() {
|
|||||||
|
|
||||||
const replaced = await invoke('copy_file_with_new_name', {
|
const replaced = await invoke('copy_file_with_new_name', {
|
||||||
path: await getBackupMetadataPath() + '\\global-metadata-unpatched.dat',
|
path: await getBackupMetadataPath() + '\\global-metadata-unpatched.dat',
|
||||||
newPath: getGameMetadataPath(),
|
newPath: await getGameMetadataPath(),
|
||||||
newName: 'global-metadata.dat'
|
newName: 'global-metadata.dat'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user