Updated the longrest repair armor to the new armor max path along with a migration (#1777)

This commit is contained in:
WBHarry 2026-04-04 23:22:25 +02:00 committed by GitHub
parent 70e21f34db
commit 0d7469801e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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);