Unit pathfinding
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package mindustry.world.blocks.defense;
|
||||
|
||||
import arc.*;
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
@@ -147,8 +146,8 @@ public class RegenProjector extends Block{
|
||||
}
|
||||
}
|
||||
|
||||
if(lastUpdateFrame != Core.graphics.getFrameId()){
|
||||
lastUpdateFrame = Core.graphics.getFrameId();
|
||||
if(lastUpdateFrame != state.updateId){
|
||||
lastUpdateFrame = state.updateId;
|
||||
|
||||
for(var entry : mendMap.entries()){
|
||||
var build = world.build(entry.key);
|
||||
|
||||
@@ -28,6 +28,7 @@ public abstract class BlockProducer extends PayloadBlock{
|
||||
update = true;
|
||||
outputsPayload = true;
|
||||
hasItems = true;
|
||||
solid = true;
|
||||
hasPower = true;
|
||||
rotate = true;
|
||||
regionRotated1 = 1;
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package mindustry.world.blocks.power;
|
||||
|
||||
import arc.*;
|
||||
import arc.math.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.world.consumers.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class PowerGraph{
|
||||
private static final Queue<Building> queue = new Queue<>();
|
||||
private static final Seq<Building> outArray1 = new Seq<>();
|
||||
@@ -206,7 +207,7 @@ public class PowerGraph{
|
||||
}
|
||||
|
||||
public void update(){
|
||||
if(Core.graphics.getFrameId() == lastFrameUpdated){
|
||||
if(state.updateId == lastFrameUpdated){
|
||||
return;
|
||||
}else if(!consumers.isEmpty() && consumers.first().cheating()){
|
||||
//when cheating, just set status to 1
|
||||
@@ -218,7 +219,7 @@ public class PowerGraph{
|
||||
return;
|
||||
}
|
||||
|
||||
lastFrameUpdated = Core.graphics.getFrameId();
|
||||
lastFrameUpdated = state.updateId;
|
||||
|
||||
float powerNeeded = getPowerNeeded();
|
||||
float powerProduced = getPowerProduced();
|
||||
|
||||
Reference in New Issue
Block a user