Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Prevent LEG from drawing significantly higher amounts of coolant than expected #243

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -426,20 +426,15 @@ public void setEssentiaToEUVoltageAndAmp(long voltageLimit, long ampLimit) {
for (EssentiaHatch hatch : this.mEssentiaHatch) {
AspectList aspects = hatch.getAspects();
for (Aspect aspect : aspects.aspects.keySet()) {
if (!isValidEssentia(aspect) || getPerAspectEnergy(aspect) == 0) continue;
if (!isValidEssentia(aspect)) continue;
while (EUt <= (voltageLimit * ampLimit) && aspects.getAmount(aspect) > 0) {
EUt += getPerAspectEnergy(aspect) * mStableValue / 25;
long addedEU = getPerAspectEnergy(aspect) * mStableValue / 25;
if (addedEU == 0) break;
EUt += addedEU;
aspects.reduce(aspect, 1);
if (aspects.getAmount(aspect) == 0) aspects.remove(aspect);
}
}
if (EUt == 0 && aspects.size() != 0) {
if (!isValidEssentia(aspects.getAspects()[0]) || getPerAspectEnergy(aspects.getAspects()[0]) == 0)
continue;
EUt += getPerAspectEnergy(aspects.getAspects()[0]) * mStableValue / 25;
aspects.reduce(aspects.getAspects()[0], 1);
if (aspects.getAmount(aspects.getAspects()[0]) == 0) aspects.remove(aspects.getAspects()[0]);
}
}

if (EUt <= voltageLimit) {
Expand Down