From d92d77483fd446412353cc7587cecedede2fcd65 Mon Sep 17 00:00:00 2001 From: soul Date: Tue, 27 Oct 2026 06:34:12 +0100 Subject: [PATCH] Retire BodyData.Resources key 4 and the commented ResourceValue No reader or writer remains; FieldKinds.Yield (this cut) is the owner of a belt's yield. Co-Authored-By: Claude Opus 5.5 --- Assets/Scripts/ServerShared/ZoneData.cs | 3 +-- Assets/Scripts/ServerShared/ZoneGenerator.cs | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Assets/Scripts/ServerShared/ZoneData.cs b/Assets/Scripts/ServerShared/ZoneData.cs index a80278566..2055b07c6 100644 --- a/Assets/Scripts/ServerShared/ZoneData.cs +++ b/Assets/Scripts/ServerShared/ZoneData.cs @@ -81,8 +81,7 @@ public abstract class BodyData [JsonProperty("mass"), Key(3)] public float Mass = 0; - [CultReference(typeof(SimpleCommodityData), many: true), JsonProperty("resources"), Key(4)] - public Dictionary, float> Resources = new Dictionary, float>(); + // MessagePack key 4 belonged to the removed stored Resources; do not reuse it. A belt's yield is derived by FieldKinds.Yield. [JsonProperty("bodyRadiusMul")] [Key(5)] public float BodyRadiusMultiplier = 1; diff --git a/Assets/Scripts/ServerShared/ZoneGenerator.cs b/Assets/Scripts/ServerShared/ZoneGenerator.cs index 426e8b92e..2a31df2b8 100644 --- a/Assets/Scripts/ServerShared/ZoneGenerator.cs +++ b/Assets/Scripts/ServerShared/ZoneGenerator.cs @@ -522,12 +522,6 @@ public static class ZoneGenerator public static Faction[] EligibleWandererFactions(Faction[] factions, Faction owner, Faction nearest) => factions.Where(f => f != owner && f != nearest).ToArray(); - // static float ResourceValue(ref Random random, ZoneGenerationSettings settings, SimpleCommodityData resource, float density) - // { - // return random.NextPowerDistribution(resource.Minimum, resource.Maximum, resource.Exponent, - // 1 / lerp(settings.ResourceDensityMinimum, settings.ResourceDensityMaximum, density)); - // } - public static GeneratorPlanet[] GenerateEntities(ZoneGenerationSettings settings, PlanetSettings planetSettings, ref Random random, float mass, float radius, float2 fixedPosition, float rootReach) {