mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-13 12:16:53 +07:00
Fixed #1198
This commit is contained in:
parent
45ce4013d0
commit
fbed11e927
@ -24,6 +24,7 @@ public class BuilderDrone extends BaseDrone implements BuilderTrait{
|
|||||||
private static final IntIntMap totals = new IntIntMap();
|
private static final IntIntMap totals = new IntIntMap();
|
||||||
|
|
||||||
protected Queue<BuildRequest> placeQueue = new Queue<>();
|
protected Queue<BuildRequest> placeQueue = new Queue<>();
|
||||||
|
protected BuildRequest lastFound;
|
||||||
protected boolean isBreaking;
|
protected boolean isBreaking;
|
||||||
protected Player playerTarget;
|
protected Player playerTarget;
|
||||||
|
|
||||||
@ -57,6 +58,9 @@ public class BuilderDrone extends BaseDrone implements BuilderTrait{
|
|||||||
buildQueue().addLast(new BuildRequest(entity.tile.x, entity.tile.y));
|
buildQueue().addLast(new BuildRequest(entity.tile.x, entity.tile.y));
|
||||||
}else{
|
}else{
|
||||||
buildQueue().addLast(new BuildRequest(entity.tile.x, entity.tile.y, entity.tile.rotation(), entity.cblock));
|
buildQueue().addLast(new BuildRequest(entity.tile.x, entity.tile.y, entity.tile.rotation(), entity.cblock));
|
||||||
|
if(lastFound != null && lastFound.hasConfig){
|
||||||
|
buildQueue().last().configure(lastFound.config);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,6 +178,7 @@ public class BuilderDrone extends BaseDrone implements BuilderTrait{
|
|||||||
BuildEntity b = tile.ent();
|
BuildEntity b = tile.ent();
|
||||||
float dist = Math.min(b.dst(x, y) - placeDistance, 0);
|
float dist = Math.min(b.dst(x, y) - placeDistance, 0);
|
||||||
if(dist / type.maxVelocity < b.buildCost * 0.9f){
|
if(dist / type.maxVelocity < b.buildCost * 0.9f){
|
||||||
|
lastFound = req;
|
||||||
target = b;
|
target = b;
|
||||||
this.isBreaking = req.breaking;
|
this.isBreaking = req.breaking;
|
||||||
setState(build);
|
setState(build);
|
||||||
|
@ -138,7 +138,7 @@ public class BlockRenderer implements Disposable{
|
|||||||
Block b = content.block(block.block);
|
Block b = content.block(block.block);
|
||||||
if(!camera.bounds(Tmp.r1).grow(tilesize * 2f).overlaps(Tmp.r2.setSize(b.size * tilesize).setCenter(block.x * tilesize + b.offset(), block.y * tilesize + b.offset()))) continue;
|
if(!camera.bounds(Tmp.r1).grow(tilesize * 2f).overlaps(Tmp.r2.setSize(b.size * tilesize).setCenter(block.x * tilesize + b.offset(), block.y * tilesize + b.offset()))) continue;
|
||||||
|
|
||||||
Draw.alpha(0.53f * brokenFade);
|
Draw.alpha(0.33f * brokenFade);
|
||||||
Draw.mixcol(Color.white, 0.2f + Mathf.absin(Time.globalTime(), 6f, 0.2f));
|
Draw.mixcol(Color.white, 0.2f + Mathf.absin(Time.globalTime(), 6f, 0.2f));
|
||||||
Draw.rect(b.icon(Cicon.full), block.x * tilesize + b.offset(), block.y * tilesize + b.offset(), b.rotate ? block.rotation * 90 : 0f);
|
Draw.rect(b.icon(Cicon.full), block.x * tilesize + b.offset(), block.y * tilesize + b.offset(), b.rotate ? block.rotation * 90 : 0f);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user