summaryrefslogtreecommitdiff
path: root/mm/2s2h/SaveManager/Migrations/6.cpp
blob: 5702a5c60152601afa5d532ef96db10d2a75ce6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "2s2h/SaveManager/SaveManager.h"
#include "z64.h"

void SaveManager_Migration_6(nlohmann::json& j) {
    // if saveType doesn't exist, create it and set it to vanilla
    if (!j["save"]["shipSaveInfo"].contains("saveType")) {
        j["save"]["shipSaveInfo"]["saveType"] = SAVETYPE_VANILLA;
    }
    if (!j["save"]["shipSaveInfo"].contains("commitHash")) {
        u8 commitHash[8] = { 0 };
        j["save"]["shipSaveInfo"]["commitHash"] = commitHash;
    }
    if (!j["save"]["shipSaveInfo"].contains("fileCreatedAt")) {
        j["save"]["shipSaveInfo"]["fileCreatedAt"] = 0;
    }
    if (!j["save"]["shipSaveInfo"].contains("fileCompletedAt")) {
        j["save"]["shipSaveInfo"]["fileCompletedAt"] = 0;
    }
}