diff --git a/core/assets-raw/sprites/blocks/turrets/bases/block-1.png b/core/assets-raw/sprites/blocks/turrets/bases/block-1.png index 43a8576c0f..36ec5be9a8 100644 Binary files a/core/assets-raw/sprites/blocks/turrets/bases/block-1.png and b/core/assets-raw/sprites/blocks/turrets/bases/block-1.png differ diff --git a/core/assets-raw/sprites/blocks/turrets/bases/block-2.png b/core/assets-raw/sprites/blocks/turrets/bases/block-2.png index b425980c32..ec0fba351a 100644 Binary files a/core/assets-raw/sprites/blocks/turrets/bases/block-2.png and b/core/assets-raw/sprites/blocks/turrets/bases/block-2.png differ diff --git a/core/assets-raw/sprites/blocks/turrets/bases/block-3.png b/core/assets-raw/sprites/blocks/turrets/bases/block-3.png index 4997c7fc3e..1b01ddd33f 100644 Binary files a/core/assets-raw/sprites/blocks/turrets/bases/block-3.png and b/core/assets-raw/sprites/blocks/turrets/bases/block-3.png differ diff --git a/core/assets-raw/sprites/blocks/turrets/bases/block-4.png b/core/assets-raw/sprites/blocks/turrets/bases/block-4.png index 7206b69d95..e1fcabc496 100644 Binary files a/core/assets-raw/sprites/blocks/turrets/bases/block-4.png and b/core/assets-raw/sprites/blocks/turrets/bases/block-4.png differ diff --git a/core/src/io/anuke/mindustry/content/Bullets.java b/core/src/io/anuke/mindustry/content/Bullets.java index 37c84c7898..504d0fed6b 100644 --- a/core/src/io/anuke/mindustry/content/Bullets.java +++ b/core/src/io/anuke/mindustry/content/Bullets.java @@ -399,7 +399,7 @@ public class Bullets implements ContentList{ super.hit(b); tile = tile.link(); - if(tile.getTeam() == b.getTeam() && !(tile.block() instanceof BuildBlock)){ + if(tile.entity != null && tile.getTeam() == b.getTeam() && !(tile.block() instanceof BuildBlock)){ Effects.effect(Fx.healBlockFull, Pal.heal, tile.drawx(), tile.drawy(), tile.block().size); tile.entity.healBy(healPercent / 100f * tile.entity.maxHealth()); } diff --git a/core/src/io/anuke/mindustry/core/NetServer.java b/core/src/io/anuke/mindustry/core/NetServer.java index ab4eca7e0d..e079ab7511 100644 --- a/core/src/io/anuke/mindustry/core/NetServer.java +++ b/core/src/io/anuke/mindustry/core/NetServer.java @@ -274,7 +274,7 @@ public class NetServer implements ApplicationListener{ long elapsed = Time.timeSinceMillis(connection.lastRecievedClientTime); float maxSpeed = boosting && !player.mech.flying ? player.mech.boostSpeed : player.mech.speed; - float maxMove = elapsed / 1000f * 60f * Math.min(compound(maxSpeed, player.mech.drag) * 1.25f, player.mech.maxSpeed * 1.1f); + float maxMove = elapsed / 1000f * 60f * Math.min(compound(maxSpeed, player.mech.drag) * 1.25f, player.mech.maxSpeed * 1.2f); player.pointerX = pointerX; player.pointerY = pointerY; @@ -284,6 +284,7 @@ public class NetServer implements ApplicationListener{ player.isShooting = shooting; player.buildQueue().clear(); for(BuildRequest req : requests){ + if(req == null) continue; Tile tile = world.tile(req.x, req.y); if(tile == null) continue; //auto-skip done requests @@ -296,7 +297,7 @@ public class NetServer implements ApplicationListener{ } vector.set(x - player.getInterpolator().target.x, y - player.getInterpolator().target.y); - //vector.limit(maxMove); + vector.limit(maxMove); float prevx = player.x, prevy = player.y; player.set(player.getInterpolator().target.x, player.getInterpolator().target.y); diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index b57bd2fa48..fef6d6bcaa 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -1,7 +1,6 @@ package io.anuke.mindustry.core; -import io.anuke.arc.ApplicationListener; -import io.anuke.arc.Core; +import io.anuke.arc.*; import io.anuke.arc.files.FileHandle; import io.anuke.arc.function.Consumer; import io.anuke.arc.function.Predicate; @@ -21,6 +20,7 @@ import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect; import io.anuke.mindustry.entities.impl.EffectEntity; import io.anuke.mindustry.entities.traits.*; import io.anuke.mindustry.entities.type.*; +import io.anuke.mindustry.game.EventType.DisposeEvent; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.graphics.*; import io.anuke.mindustry.world.blocks.defense.ForceProjector.ShieldEntity; @@ -130,6 +130,7 @@ public class Renderer implements ApplicationListener{ minimap.dispose(); shieldBuffer.dispose(); blocks.dispose(); + Events.fire(new DisposeEvent()); } void updateShake(float scale){ diff --git a/core/src/io/anuke/mindustry/entities/effect/RubbleDecal.java b/core/src/io/anuke/mindustry/entities/effect/RubbleDecal.java index 7944714f6b..8f2fb733ef 100644 --- a/core/src/io/anuke/mindustry/entities/effect/RubbleDecal.java +++ b/core/src/io/anuke/mindustry/entities/effect/RubbleDecal.java @@ -8,22 +8,14 @@ import io.anuke.arc.math.Mathf; import static io.anuke.mindustry.Vars.headless; public class RubbleDecal extends Decal{ - private static final TextureRegion[][] regions = new TextureRegion[16][0]; private TextureRegion region; /** Creates a rubble effect at a position. Provide a block size to use. */ public static void create(float x, float y, int size){ if(headless) return; - if(regions[size].length == 0 || regions[size][0].getTexture().isDisposed()){ - regions[size] = new TextureRegion[2]; - for(int j = 0; j < 2; j++){ - regions[size][j] = Core.atlas.find("rubble-" + size + "-" + j); - } - } - RubbleDecal decal = new RubbleDecal(); - decal.region = regions[size][Mathf.clamp(Mathf.randomSeed(decal.id, 0, 1), 0, regions[size].length - 1)]; + decal.region = Core.atlas.find("rubble-" + size + "-" + Mathf.randomSeed(decal.id, 0, 1)); if(!Core.atlas.isFound(decal.region)){ return; diff --git a/core/src/io/anuke/mindustry/game/EventType.java b/core/src/io/anuke/mindustry/game/EventType.java index de0a286c66..8bc340ce2e 100644 --- a/core/src/io/anuke/mindustry/game/EventType.java +++ b/core/src/io/anuke/mindustry/game/EventType.java @@ -32,6 +32,10 @@ public class EventType{ } + public static class DisposeEvent{ + + } + public static class PlayEvent{ } diff --git a/core/src/io/anuke/mindustry/io/TypeIO.java b/core/src/io/anuke/mindustry/io/TypeIO.java index d8bdbf9b4c..97f92584f2 100644 --- a/core/src/io/anuke/mindustry/io/TypeIO.java +++ b/core/src/io/anuke/mindustry/io/TypeIO.java @@ -139,6 +139,10 @@ public class TypeIO{ int position = buffer.getInt(); BuildRequest currentRequest; + if(world.tile(position) == null){ + continue; + } + if(type == 1){ //remove currentRequest = new BuildRequest(Pos.x(position), Pos.y(position)); }else{ //place diff --git a/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java b/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java index 9016bfac92..a2c1410a50 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java @@ -40,6 +40,7 @@ public class PowerGraph{ public float getPowerProduced(){ float powerProduced = 0f; for(Tile producer : producers){ + if(producer.entity == null) continue; powerProduced += producer.block().getPowerProduction(producer) * producer.entity.delta(); } return powerProduced; diff --git a/desktop/src/io/anuke/mindustry/desktop/DesktopPlatform.java b/desktop/src/io/anuke/mindustry/desktop/DesktopPlatform.java index fa935f50a9..8bd64f4689 100644 --- a/desktop/src/io/anuke/mindustry/desktop/DesktopPlatform.java +++ b/desktop/src/io/anuke/mindustry/desktop/DesktopPlatform.java @@ -49,7 +49,7 @@ public class DesktopPlatform extends Platform{ if(e.getMessage() != null && (e.getMessage().contains("Couldn't create window") || e.getMessage().contains("OpenGL 2.0 or higher"))){ dialog.accept(() -> TinyFileDialogs.tinyfd_messageBox("oh no", - e.getMessage().contains("Couldn't create window") ? "A graphics initialization error has occured! Try to update your graphics drivers.\nReport this to the developer." : + e.getMessage().contains("Couldn't create window") ? "A graphics initialization error has occured! Try to update your graphics drivers:\n" + e.getMessage() : "Your graphics card does not support OpenGL 2.0!\n" + "Try to update your graphics drivers.\n\n" + "(If that doesn't work, your computer just doesn't support Mindustry.)", "ok", "error", true));