Skip to main content

Function: migrateToCurrentVersion()

migrateToCurrentVersion(data, fromVersion, options?): MigrationResult

Defined in: packages/core/src/saves/migrations/runner.ts:184

Convenience function to migrate save data to the current game version.

Parameters

data

GameSaveState

The save data to migrate

fromVersion

string

The version the save was created with

options?

MigrationOptions

Migration behavior options

Returns

MigrationResult

Migration result

Example

const result = migrateToCurrentVersion(saveData, "1.0.0");
if (result.success) {
Game.setState(result.data);
}