[BUG 0.0.1.4a] fuel cell doesn't switch to the "Fuel Deprived" state if you run out of any of the currently used resources and continues to produce EC
zer0Kerbal opened this issue ยท 1 comments
[BUG 0.0.1.4a] fuel cell doesn't switch to the "Fuel Deprived" state if you run out of any of the currently used resources and continues to produce EC
ElectricChargeID needed to be replaced with fuel.resourceID
This is the buggy code:
ODFC.cs
foreach (Fuel fuel in ODFC_config.modes[fuelMode].fuels) {
// Determine activity based on available fuel
amount = 0;
part.GetConnectedResourceTotals(ElectricChargeID, out amount, out maxAmount);
foreach (PartResource r in resources)
amount += r.amount;
cfTime = Math.Min(cfTime, amount / (fuel.rate * rateLimit));
}
This is the corrected code:
foreach (Fuel fuel in ODFC_config.modes[fuelMode].fuels) {
// Determine activity based on available fuel
amount = 0;
part.GetConnectedResourceTotals(fuel.resourceID, out amount, out maxAmount);
foreach (PartResource r in resources)
amount += r.amount;
cfTime = Math.Min(cfTime, amount / (fuel.rate * rateLimit));
}