diff --git a/core/assets/maps/saltFlats.msav b/core/assets/maps/saltFlats.msav index ca47b1b82e..787abceb55 100644 Binary files a/core/assets/maps/saltFlats.msav and b/core/assets/maps/saltFlats.msav differ diff --git a/core/src/io/anuke/mindustry/Mindustry.java b/core/src/io/anuke/mindustry/Mindustry.java index 2d62924704..82f14aaa05 100644 --- a/core/src/io/anuke/mindustry/Mindustry.java +++ b/core/src/io/anuke/mindustry/Mindustry.java @@ -21,6 +21,7 @@ public class Mindustry extends ApplicationCore{ }); Time.mark(); + Vars.init(); Log.setUseColors(false); BundleLoader.load(); @@ -34,8 +35,6 @@ public class Mindustry extends ApplicationCore{ add(ui = new UI()); add(netServer = new NetServer()); add(netClient = new NetClient()); - - Events.fire(new GameLoadEvent()); } @Override @@ -64,5 +63,6 @@ public class Mindustry extends ApplicationCore{ super.init(); Log.info("Time to load [total]: {0}", Time.elapsed()); + Events.fire(new GameLoadEvent()); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java b/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java index 251a068866..03b23b0568 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java @@ -27,7 +27,7 @@ public class PowerNode extends PowerBlock{ //last distribution block placed private static int lastPlaced = -1; - protected Vector2 t1 = new Vector2(); + protected Vector2 t1 = new Vector2(), t2 = new Vector2(); protected TextureRegion laser, laserEnd; protected float laserRange = 6; @@ -211,7 +211,7 @@ public class PowerNode extends PowerBlock{ for(int i = 0; i < entity.power.links.size; i++){ Tile link = world.tile(entity.power.links.get(i)); - if(link != null && (link.pos() < tile.pos() || !(link.block() instanceof PowerNode) || !Core.camera.bounds(Tmp.r1).contains(link.drawx(), link.drawy()))){ + if(linkValid(tile, link) && (link.pos() < tile.pos() || !(link.block() instanceof PowerNode) || !Core.camera.bounds(Tmp.r1).contains(link.drawx(), link.drawy()))){ drawLaser(tile, link); } } @@ -248,13 +248,13 @@ public class PowerNode extends PowerBlock{ x2 = target.drawx(), y2 = target.drawy(); float angle1 = Angles.angle(x1, y1, x2, y2); - t1.trns(angle1, tile.block().size * tilesize / 2f - 1.5f); + t2.trns(angle1 + 180f, target.block().size * tilesize / 2f - 1.5f); x1 += t1.x; y1 += t1.y; - x2 -= t1.x; - y2 -= t1.y; + x2 += t2.x; + y2 += t2.y; Draw.color(Pal.powerLight, Color.WHITE, Mathf.absin(Time.time(), 8f, 0.3f) + 0.2f); Shapes.laser(laser, laserEnd, x1, y1, x2, y2, 0.6f);