Misc bugfixes
This commit is contained in:
@@ -13,7 +13,7 @@ import mindustry.gen.*;
|
|||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
public class CommandAI extends AIController{
|
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 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 Vec2 vecOut = new Vec2(), flockVec = new Vec2(), separation = new Vec2(), cohesion = new Vec2(), massCenter = new Vec2();
|
||||||
protected static final boolean[] noFound = {false};
|
protected static final boolean[] noFound = {false};
|
||||||
|
|||||||
@@ -439,9 +439,16 @@ public class Weapon implements Cloneable{
|
|||||||
shoot.shoot(mount.barrelCounter, (xOffset, yOffset, angle, delay, mover) -> {
|
shoot.shoot(mount.barrelCounter, (xOffset, yOffset, angle, delay, mover) -> {
|
||||||
//this is incremented immediately, as it is used for total bullet creation amount detection
|
//this is incremented immediately, as it is used for total bullet creation amount detection
|
||||||
mount.totalShots ++;
|
mount.totalShots ++;
|
||||||
|
int barrel = mount.barrelCounter;
|
||||||
|
|
||||||
if(delay > 0f){
|
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{
|
}else{
|
||||||
bullet(unit, mount, xOffset, yOffset, angle, mover);
|
bullet(unit, mount, xOffset, yOffset, angle, mover);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -561,8 +561,16 @@ public class Turret extends ReloadTurret{
|
|||||||
|
|
||||||
shoot.shoot(barrelCounter, (xOffset, yOffset, angle, delay, mover) -> {
|
shoot.shoot(barrelCounter, (xOffset, yOffset, angle, delay, mover) -> {
|
||||||
queuedBullets++;
|
queuedBullets++;
|
||||||
|
int barrel = barrelCounter;
|
||||||
|
|
||||||
if(delay > 0f){
|
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{
|
}else{
|
||||||
bullet(type, xOffset, yOffset, angle, mover);
|
bullet(type, xOffset, yOffset, angle, mover);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class ConsumeLiquids extends Consume{
|
|||||||
@Override
|
@Override
|
||||||
public float efficiency(Building build){
|
public float efficiency(Building build){
|
||||||
float mult = multiplier.get(build);
|
float mult = multiplier.get(build);
|
||||||
float ed = build.edelta();
|
float ed = build.edelta() * build.efficiencyScale();
|
||||||
if(ed <= 0.00000001f) return 0f;
|
if(ed <= 0.00000001f) return 0f;
|
||||||
float min = 1f;
|
float min = 1f;
|
||||||
for(var stack : liquids){
|
for(var stack : liquids){
|
||||||
|
|||||||
Reference in New Issue
Block a user