From a00054aa7e01414253a62d37b30c4b27267011de Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 10 Oct 2026 11:09:59 +0200 Subject: [PATCH] LoadoutGenerator: a station stocks its consumable before the gear Sixteen gear picks drawn with replacement fill a shipped station hold, so a station whose roll hit usually stored nothing (29 of 400 held one against the ruled quarter). The consumable step now runs before the gear fill; with no consumable on offer it still draws nothing, so generation is unchanged. Ships keep their step after OutfitEntity. Co-Authored-By: Claude Opus 5.5 --- Assets/Scripts/ServerShared/LoadoutGenerator.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/ServerShared/LoadoutGenerator.cs b/Assets/Scripts/ServerShared/LoadoutGenerator.cs index 9566b19c3..ca89ac58d 100644 --- a/Assets/Scripts/ServerShared/LoadoutGenerator.cs +++ b/Assets/Scripts/ServerShared/LoadoutGenerator.cs @@ -116,6 +116,11 @@ public class LoadoutGenerator FillInterior(entity); + // The consumable goes in before the gear stock: sixteen gear picks drawn with replacement can fill a real hold, + // and a roll that hit must leave the entity holding one (the ruled rate is the rule). With no consumable on + // offer nothing is drawn here, so the gear draws are exactly what they were. + StockConsumables(entity, StationConsumableChance, StationConsumableUnits); + var cargo = entity.CargoBays.First(); var inventory = RandomProducts(16, 1, data => !(data is HullData hull && hull.HullType != HullType.Ship) && !(data is CargoBayData)) @@ -126,14 +131,12 @@ public class LoadoutGenerator cargo.TryStore(instance); } - StockConsumables(entity, StationConsumableChance, StationConsumableUnits); - entity.CanTow = hullData.CanTow; return EntitySerializer.Pack(entity) as OrbitalEntityPack; } - // The last thing a loadout does. With no consumable on offer, or no hold to put one in, nothing is drawn, so a + // A loadout's one consumable step. With no consumable on offer, or no hold to put one in, nothing is drawn, so a // catalog without consumables generates exactly what it did before them. Otherwise one roll decides whether the // entity has any, and a hit stocks 1 to maxUnits instances of one product, stopping when no hold takes another. private void StockConsumables(Entity entity, float chance, int maxUnits)