Skip to content

Commit

Permalink
Update saveData.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Zethoun authored Feb 23, 2024
1 parent 5e3ffa8 commit 690c5cd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions saveData.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PLAYER DATA CHANGE LOG
*/

const blankPlayer = {
version: 12,
version: 15,
activePortal: 'academyEffector',
colorProfile: {
academyProjects: ['#444444', '#CCCC44', '#44CC44', '#4444CC'],
Expand Down Expand Up @@ -334,8 +334,11 @@ function ResetPlayerData() {
}

// Add new properties to player data object upon opening newer version of Super Assistant
function UpdatePlayerData() {
SavePlayerData()
function UpdatePlayerData(data) {
if (playerData.academy.farms !== GameDB.academy.planets * 3) {
playerData.academy.farms = blankPlayer.academy.farms
}
SavePlayerData(data)
}

// This part is just saved for future reference from my console-based project
Expand Down Expand Up @@ -371,4 +374,6 @@ function UpdatePlayerData() {
// GenerateMilestoneAccess();

// Run automatic update of player data when the Super Assistant it was saved from is outdated
if (playerData.version < blankPlayer.version) UpdatePlayerData()
if (playerData.version < blankPlayer.version) {
UpdatePlayerData(blankPlayer)
}

0 comments on commit 690c5cd

Please sign in to comment.