Misc bugfixes

This commit is contained in:
Anuken
2023-09-21 14:28:08 -04:00
parent 1c76087930
commit d9c607995b
4 changed files with 19 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ import mindustry.gen.*;
import mindustry.world.*;
public class CommandAI extends AIController{
protected static final int maxCommandQueueSize = 64;
protected static final int maxCommandQueueSize = 50;
protected static final float localInterval = 40f;
protected static final Vec2 vecOut = new Vec2(), flockVec = new Vec2(), separation = new Vec2(), cohesion = new Vec2(), massCenter = new Vec2();
protected static final boolean[] noFound = {false};

View File

@@ -439,9 +439,16 @@ public class Weapon implements Cloneable{
shoot.shoot(mount.barrelCounter, (xOffset, yOffset, angle, delay, mover) -> {
//this is incremented immediately, as it is used for total bullet creation amount detection
mount.totalShots ++;
int barrel = mount.barrelCounter;
if(delay > 0f){
Time.run(delay, () -> bullet(unit, mount, xOffset, yOffset, angle, mover));
Time.run(delay, () -> {
//hack: make sure the barrel is the same as what it was when the bullet was queued to fire
int prev = mount.barrelCounter;
mount.barrelCounter = barrel;
bullet(unit, mount, xOffset, yOffset, angle, mover);
mount.barrelCounter = prev;
});
}else{
bullet(unit, mount, xOffset, yOffset, angle, mover);
}

View File

@@ -561,8 +561,16 @@ public class Turret extends ReloadTurret{
shoot.shoot(barrelCounter, (xOffset, yOffset, angle, delay, mover) -> {
queuedBullets++;
int barrel = barrelCounter;
if(delay > 0f){
Time.run(delay, () -> bullet(type, xOffset, yOffset, angle, mover));
Time.run(delay, () -> {
//hack: make sure the barrel is the same as what it was when the bullet was queued to fire
int prev = barrelCounter;
barrelCounter = barrel;
bullet(type, xOffset, yOffset, angle, mover);
barrelCounter = prev;
});
}else{
bullet(type, xOffset, yOffset, angle, mover);
}

View File

@@ -51,7 +51,7 @@ public class ConsumeLiquids extends Consume{
@Override
public float efficiency(Building build){
float mult = multiplier.get(build);
float ed = build.edelta();
float ed = build.edelta() * build.efficiencyScale();
if(ed <= 0.00000001f) return 0f;
float min = 1f;
for(var stack : liquids){