refactor(migration): 简化父行星 ID 的映射更新逻辑

- 移除冗余的 idMap.has 检查,直接使用 idMap.get 获取新 ID
This commit is contained in:
wenyu
2026-03-18 18:30:54 +08:00
parent bd46c24824
commit b0a7b5ce90

View File

@@ -141,12 +141,10 @@ export const migrateGameData = (): void => {
const posKey = `${planet.position.galaxy}:${planet.position.system}:${planet.position.position}`
const mapKey = `${planet.parentPlanetId}_${posKey}`
if (idMap.has(mapKey)) {
const newParentId = idMap.get(mapKey)
if (newParentId) {
planet.parentPlanetId = newParentId
needsSave = true
}
const newParentId = idMap.get(mapKey)
if (newParentId) {
planet.parentPlanetId = newParentId
needsSave = true
}
}
})