From 09de573f7f5b37d26a9f91e93e4bc99d3d65ea4c Mon Sep 17 00:00:00 2001 From: blowfish Date: Thu, 26 Jan 2017 21:16:36 -0800 Subject: [PATCH] Switch percentFilled priority Now that resource overrides can be defined on individual subtypes, individual resources should take priority. --- B9PartSwitch/PartSwitch/PartSubtype.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/B9PartSwitch/PartSwitch/PartSubtype.cs b/B9PartSwitch/PartSwitch/PartSubtype.cs index 39eec05a..28287141 100644 --- a/B9PartSwitch/PartSwitch/PartSubtype.cs +++ b/B9PartSwitch/PartSwitch/PartSubtype.cs @@ -229,7 +229,7 @@ public void AddResources(bool fillTanks) foreach (TankResource resource in tankType.resources) { float amount = TotalVolume * resource.unitsPerVolume * parent.VolumeScale; - float filledProportion = (percentFilled ?? resource.percentFilled ?? tankType.percentFilled ?? 100f) * 0.01f; + float filledProportion = (resource.percentFilled ?? percentFilled ?? tankType.percentFilled ?? 100f) * 0.01f; PartResource partResource = Part.AddOrCreateResource(resource.resourceDefinition, amount, amount * filledProportion, fillTanks); bool? tweakable = resourcesTweakable ?? tankType.resourcesTweakable;