only unpatch when game was patched automatically

This commit is contained in:
SpikeHD
2022-07-19 17:49:40 -07:00
parent d23d5e3806
commit 1a6ed38f8f

View File

@@ -63,12 +63,16 @@ class App extends React.Component<IProps, IState> {
// Emitted for metadata replacing-purposes // Emitted for metadata replacing-purposes
listen('game_closed', async () => { listen('game_closed', async () => {
const unpatched = await unpatchGame() const wasPatched = await getConfigOption('patch_metadata')
console.log(`unpatched game? ${unpatched}`) if (wasPatched) {
const unpatched = await unpatchGame()
if (!unpatched) { console.log(`unpatched game? ${unpatched}`)
alert(`Could not unpatch game! (You should be able to find your metadata backup in ${await dataDir()}\\cultivation\\)`)
if (!unpatched) {
alert(`Could not unpatch game! (You should be able to find your metadata backup in ${await dataDir()}\\cultivation\\)`)
}
} }
}) })