mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-22 04:28:27 +07:00
Fixed HeatCrafter Consumes Less Liquid (#7288)
This commit is contained in:
parent
fae3360dfc
commit
0802941cb8
@ -1685,6 +1685,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Calculate your own efficiency multiplier. */
|
||||||
|
public float efficiencyScale(){
|
||||||
|
return 1f;
|
||||||
|
}
|
||||||
|
|
||||||
public void updateConsumption(){
|
public void updateConsumption(){
|
||||||
//everything is valid when cheating
|
//everything is valid when cheating
|
||||||
if(!block.hasConsumers || cheating()){
|
if(!block.hasConsumers || cheating()){
|
||||||
|
@ -72,6 +72,7 @@ public class HeatCrafter extends GenericCrafter{
|
|||||||
potentialEfficiency *= efficiencyScale();
|
potentialEfficiency *= efficiencyScale();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float efficiencyScale(){
|
public float efficiencyScale(){
|
||||||
float over = Math.max(heat - heatRequirement, 0f);
|
float over = Math.max(heat - heatRequirement, 0f);
|
||||||
return Math.min(Mathf.clamp(heat / heatRequirement) + over / heatRequirement * overheatScale, maxEfficiency);
|
return Math.min(Mathf.clamp(heat / heatRequirement) + over / heatRequirement * overheatScale, maxEfficiency);
|
||||||
|
@ -40,7 +40,7 @@ public class ConsumeLiquid extends ConsumeLiquidBase{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float efficiency(Building build){
|
public float efficiency(Building build){
|
||||||
float ed = build.edelta();
|
float ed = build.edelta() * build.efficiencyScale();
|
||||||
if(ed <= 0.00000001f) return 0f;
|
if(ed <= 0.00000001f) return 0f;
|
||||||
//there can be more liquid than necessary, so cap at 1
|
//there can be more liquid than necessary, so cap at 1
|
||||||
return Math.min(build.liquids.get(liquid) / (amount * ed), 1f);
|
return Math.min(build.liquids.get(liquid) / (amount * ed), 1f);
|
||||||
|
Loading…
Reference in New Issue
Block a user