Updated the longrest repair armor to the new armor max path along with a migration

This commit is contained in:
WBHarry 2026-04-04 19:39:56 +02:00
parent 70e21f34db
commit b1c104634c
3 changed files with 15 additions and 2 deletions

View file

@ -1,3 +1,4 @@
import { defaultRestOptions } from '../config/generalConfig.mjs';
import { RefreshType, socketEvent } from './socket.mjs';
export async function runMigrations() {
@ -341,6 +342,18 @@ export async function runMigrations() {
lastMigrationVersion = '2.0.0';
}
if (foundry.utils.isNewerVersion('2.0.4', lastMigrationVersion)) {
const downtimeMoves = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew);
if (restMoves.longRest.moves.repairArmor) {
await downtimeMoves.updateSource({
'restMoves.longRest.moves.repairArmor': defaultRestOptions.longRest().repairArmor
});
game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew, downtimeMoves.toObject());
}
lastMigrationVersion = '2.0.4';
}
//#endregion
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, lastMigrationVersion);