refactor: clarify simulation ownership
This commit is contained in:
@@ -177,6 +177,7 @@ static func _migrate_legacy(legacy_data: Dictionary, version: int) -> Dictionary
|
||||
if version == LEGACY_SCHEMA_VERSION:
|
||||
var village_data: Dictionary = legacy_data.get("village", {})
|
||||
var initial_food := float(village_data.get("food", 0.0))
|
||||
var initial_wood := float(village_data.get("wood", 0.0))
|
||||
migrated["storages"] = [
|
||||
(
|
||||
StorageStateRecord
|
||||
@@ -185,6 +186,14 @@ static func _migrate_legacy(legacy_data: Dictionary, version: int) -> Dictionary
|
||||
{String(SimulationIds.RESOURCE_FOOD): initial_food}
|
||||
)
|
||||
. to_dictionary()
|
||||
),
|
||||
(
|
||||
StorageStateRecord
|
||||
. create(
|
||||
SimulationIds.STORAGE_VILLAGE_WOODPILE,
|
||||
{String(SimulationIds.RESOURCE_WOOD): initial_wood}
|
||||
)
|
||||
. to_dictionary()
|
||||
)
|
||||
]
|
||||
migrated["economic_events"] = []
|
||||
|
||||
Reference in New Issue
Block a user