Skip to content

Commit

Permalink
Switch percentFilled priority
Browse files Browse the repository at this point in the history
Now that resource overrides can be defined on individual subtypes,
individual resources should take priority.
  • Loading branch information
blowfishpro committed Jan 27, 2017
1 parent 9acb8dd commit 09de573
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion B9PartSwitch/PartSwitch/PartSubtype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 09de573

Please sign in to comment.