Merge branch 'master' of https://github.com/Anuken/Mindustry into map_4

This commit is contained in:
Anuken
2022-09-29 17:20:54 -04:00
2 changed files with 9 additions and 5 deletions

View File

@@ -184,6 +184,9 @@ public class CommandAI extends AIController{
}else if(target != null){
faceTarget();
}
//boosting control is not supported, so just don't.
unit.updateBoosting(false);
}
@Override
@@ -236,8 +239,6 @@ public class CommandAI extends AIController{
pathId = Vars.controlPath.nextTargetId();
}
/*
//TODO ひどい

View File

@@ -240,14 +240,17 @@ public class GenericCrafter extends Block{
@Override
public float getProgressIncrease(float baseTime){
//limit progress increase by maximum amount of liquid it can produce
float scaling = 1f;
float scaling = 1f, max = 0f;
if(outputLiquids != null){
for(var s : outputLiquids){
scaling = Math.min(scaling, (liquidCapacity - liquids.get(s.liquid)) / (s.amount * edelta()));
float value = (liquidCapacity - liquids.get(s.liquid)) / (s.amount * edelta());
scaling = Math.min(scaling, value);
max = Math.max(max, value);
}
}
return super.getProgressIncrease(baseTime) * scaling;
//when dumping excess take the maximum value instead of the minimum.
return super.getProgressIncrease(baseTime) * (dumpExtraLiquid ? Math.min(max, 1f) : scaling);
}
public float warmupTarget(){