diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 6afce340ee..8150f67ba9 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="30" + android:versionName="3.03" > diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index 3fef00d29a..397728ef71 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -26,6 +26,7 @@ import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.ItemStack; import io.anuke.mindustry.resource.Weapon; import io.anuke.mindustry.world.*; +import io.anuke.mindustry.world.blocks.ProductionBlocks; import io.anuke.ucore.UCore; import io.anuke.ucore.core.*; import io.anuke.ucore.entities.Entities; @@ -178,6 +179,17 @@ public class Control extends Module{ GameState.set(State.playing); } + public void findCore(){ + for(int x = 0; x < Vars.world.width(); x ++){ + for(int y = 0; y < Vars.world.height(); y ++){ + if(world.tile(x, y).block() == ProductionBlocks.core){ + core = world.tile(x, y); + return; + } + } + } + } + public Tile getCore(){ return core; } diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index 73aaf8d443..d93600c71e 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -98,6 +98,10 @@ public class Renderer extends RendererModule{ clearScreen(); }else{ boolean smoothcam = Settings.getBool("smoothcam"); + + if(control.core == null){ //how is this possible? apparently it is + control.findCore(); + } if(control.core.block() == ProductionBlocks.core){ diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index 5418e662b2..0a862bdff6 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -38,7 +38,7 @@ public class Player extends DestructibleEntity{ @Override public void damage(int amount){ - if(!Vars.debug) + if(!Vars.debug && !Vars.android) super.damage(amount); } diff --git a/core/src/io/anuke/mindustry/entities/TileEntity.java b/core/src/io/anuke/mindustry/entities/TileEntity.java index 0d8d1bb216..8849d22222 100644 --- a/core/src/io/anuke/mindustry/entities/TileEntity.java +++ b/core/src/io/anuke/mindustry/entities/TileEntity.java @@ -65,6 +65,7 @@ public class TileEntity extends Entity{ block.onDestroyed(tile); Vars.world.removeBlock(tile); + remove(); } public void collision(Bullet other){ @@ -91,6 +92,10 @@ public class TileEntity extends Entity{ Effects.effect(Fx.smoke, x+Mathf.range(4), y+Mathf.range(4)); } + if(health <= 0){ + onDeath(); + } + tile.block().update(tile); } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java index 2d066a4153..639323a9bc 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java @@ -109,7 +109,7 @@ public class Turret extends Block{ public void drawSelect(Tile tile){ Vector2 offset = getPlaceOffset(); - Draw.color("green"); + Draw.color(Color.GREEN); Draw.dashCircle(tile.worldx() + offset.x, tile.worldy() + offset.y, range); Draw.reset(); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java index e2b264ae8a..8be21df16b 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java @@ -38,6 +38,7 @@ public class Sorter extends Junction implements Configurable{ @Override public boolean acceptItem(Item item, Tile dest, Tile source){ + if(source.block() instanceof Sorter) return false; Tile to = getTileTarget(item, dest, source, false); return to != null && to.block().acceptItem(item, to, dest); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java index b19b72d9b2..ed64f22235 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java @@ -23,6 +23,7 @@ public class TunnelConveyor extends Block{ @Override public void handleItem(Item item, Tile tile, Tile source){ Tile tunnel = getDestTunnel(tile); + if(tunnel == null) return; //TODO how is this possible? HOW DID THEY ACHIEVE SUCH A FEAT?! Tile to = tunnel.getNearby()[tunnel.getRotation()]; Timers.run(25, ()->{