mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
refactor(migration): 简化父行星 ID 的映射更新逻辑
- 移除冗余的 idMap.has 检查,直接使用 idMap.get 获取新 ID
This commit is contained in:
@@ -141,12 +141,10 @@ export const migrateGameData = (): void => {
|
|||||||
const posKey = `${planet.position.galaxy}:${planet.position.system}:${planet.position.position}`
|
const posKey = `${planet.position.galaxy}:${planet.position.system}:${planet.position.position}`
|
||||||
const mapKey = `${planet.parentPlanetId}_${posKey}`
|
const mapKey = `${planet.parentPlanetId}_${posKey}`
|
||||||
|
|
||||||
if (idMap.has(mapKey)) {
|
const newParentId = idMap.get(mapKey)
|
||||||
const newParentId = idMap.get(mapKey)
|
if (newParentId) {
|
||||||
if (newParentId) {
|
planet.parentPlanetId = newParentId
|
||||||
planet.parentPlanetId = newParentId
|
needsSave = true
|
||||||
needsSave = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user