Improved liquid bridge throughput

This commit is contained in:
Anuken
2021-01-25 16:16:38 -05:00
parent 5930e3c350
commit b83c76f728
3 changed files with 7 additions and 3 deletions

View File

@@ -536,6 +536,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
}
public void dumpLiquid(Liquid liquid){
dumpLiquid(liquid, 2f);
}
public void dumpLiquid(Liquid liquid, float scaling){
int dump = this.cdump;
if(liquids.get(liquid) <= 0.0001f) return;
@@ -551,7 +555,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
float ofract = other.liquids.get(liquid) / other.block.liquidCapacity;
float fract = liquids.get(liquid) / block.liquidCapacity;
if(ofract < fract) transferLiquid(other, (fract - ofract) * block.liquidCapacity / 2f, liquid);
if(ofract < fract) transferLiquid(other, (fract - ofract) * block.liquidCapacity / scaling, liquid);
}
}