Skip to content

Commit

Permalink
HotFix: manually setting the game path was causing corrupt files.
Browse files Browse the repository at this point in the history
This one is on me, I screwed up big, my humble apologies.
  • Loading branch information
jtsage committed Nov 9, 2022
1 parent 1fb4fa5 commit 14e0df4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion modAssist_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ let foldersDirty = true
let firstMin = true

let gameSettings = mcStore.get('game_settings')

if ( ! gameSettings.endsWith('.xml') ) {
gameSettings = path.join(pathBestGuess, 'gameSettings.xml')
mcStore.set('game_settings', gameSettings)
}

let gameSettingsXML = null
let overrideFolder = null
let overrideIndex = '999'
Expand Down Expand Up @@ -693,7 +699,6 @@ ipcMain.on('toMain_setGamePath', (event) => {
}).then((result) => {
if ( ! result.canceled ) {
mcStore.set('game_path', result.filePaths[0])
gameSettings = result.filePaths[0]
parseSettings()
refreshClientModList()
event.sender.send( 'fromMain_allSettings', mcStore.store )
Expand Down Expand Up @@ -800,6 +805,12 @@ function modIdsToRecords(mods) {

/** Business Functions */
function parseSettings(newSetting = false) {
if ( ! gameSettings.endsWith('.xml') ) {
log.log.danger(`Game settings is not an xml file ${gameSettings}, fixing`, 'game-settings')
gameSettings = path.join(pathBestGuess, 'gameSettings.xml')
mcStore.set('game_settings', gameSettings)
}

let XMLString = ''
const XMLParser = new fxml.XMLParser({
commentPropName : '#comment',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fsg-mod-assistant",
"version": "1.0.0",
"version": "1.0.1",
"description": "FSG Farm Sim Mod Assistant",
"main": "modAssist_main.js",
"homepage": "https://github.com/FSGModding/FSG_Mod_Assistant#readme",
Expand Down

0 comments on commit 14e0df4

Please sign in to comment.