From 84c593823651dfd3a53c6a6f310de7e22c93b1b7 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 12 Dec 2017 15:43:02 -0500 Subject: [PATCH] Fix major bug with dumping of blocks and conveyors --- android/AndroidManifest.xml | 4 ++-- core/src/io/anuke/mindustry/Vars.java | 4 ++-- core/src/io/anuke/mindustry/core/UI.java | 2 +- .../mindustry/ui/fragments/BlocksFragment.java | 4 ++-- core/src/io/anuke/mindustry/world/Block.java | 14 +++++--------- core/src/io/anuke/mindustry/world/Tile.java | 2 +- .../world/blocks/types/distribution/Conveyor.java | 2 +- 7 files changed, 14 insertions(+), 18 deletions(-) diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 021d22f2ca..2969dc9635 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="27" + android:versionName="3.0" > diff --git a/core/src/io/anuke/mindustry/Vars.java b/core/src/io/anuke/mindustry/Vars.java index e2cedc2425..2fa54148dd 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -85,8 +85,8 @@ public class Vars{ "- Music made by [GREEN]RoccoW[] / found on [lime]FreeMusicArchive.org[]", "", "Special thanks to:", - "- MitchellFJN: extensive playtesting and feedback", - "- Luxray5474: wiki work, code contributions", + "- [coral]MitchellFJN[]: extensive playtesting and feedback", + "- [sky]Luxray5474[]: wiki work, code contributions", "- All the beta testers on itch.io and Google Play" }; } diff --git a/core/src/io/anuke/mindustry/core/UI.java b/core/src/io/anuke/mindustry/core/UI.java index 9eb6418e86..5a903f5b11 100644 --- a/core/src/io/anuke/mindustry/core/UI.java +++ b/core/src/io/anuke/mindustry/core/UI.java @@ -112,7 +112,7 @@ public class UI extends SceneModule{ Draw.color(); TextureRegion back = Draw.region("background"); - float backscl = 4.5f; + float backscl = 5f; Draw.alpha(0.7f); Core.batch.draw(back, w/2 - back.getRegionWidth()*backscl/2 +240f, h/2 - back.getRegionHeight()*backscl/2 + 250f, diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java index 65f1e4ae57..9a4fbf018f 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java @@ -157,7 +157,7 @@ public class BlocksFragment implements Fragment{ header.addImage(region).size(8*5).padTop(4).units(Unit.dp); Label nameLabel = new Label(recipe.result.formalName); nameLabel.setWrap(true); - header.add(nameLabel).padLeft(2).width(135f).units(Unit.dp); + header.add(nameLabel).padLeft(2).width(130f).units(Unit.dp); //extra info if(recipe.result.fullDescription != null){ @@ -203,7 +203,7 @@ public class BlocksFragment implements Fragment{ }).size(110, 50).pad(10f).units(Unit.dp); d.show(); - }).expandX().padLeft(4).top().right().size(42f, 46f).padTop(-2).units(Unit.dp); + }).expandX().padLeft(3).top().right().size(40f, 44f).padTop(-2).units(Unit.dp); } diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index bac406c265..dfec7fcb2a 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -144,16 +144,13 @@ public class Block{ * containers, it gets added to the block's inventory.*/ protected void offloadNear(Tile tile, Item item){ byte i = tile.getDump(); - byte pdump = tile.getDump(); + byte pdump = i; Tile[] tiles = tile.getNearby(); for(int j = 0; j < 4; j ++){ Tile other = tiles[i]; - if(other != null && other.block().acceptItem(item, other, tile) - //don't output to things facing this thing - && !(other.block().rotate && (other.getRotation() + 2) % 4 == i)){ - + if(other != null && other.block().acceptItem(item, other, tile)){ other.block().handleItem(item, other, tile); tile.setDump((byte)((i+1)%4)); return; @@ -181,20 +178,19 @@ public class Block{ for(int j = 0; j < 4; j ++){ Tile other = tiles[i]; - if(i == direction || direction == -1) + if(i == direction || direction == -1){ for(Item item : Item.values()){ if(todump != null && item != todump) continue; - if(tile.entity.hasItem(item) && other != null && other.block().acceptItem(item, other, tile) - //don't output to things facing this thing - /*!(other.block().rotate && (other.getRotation() + 2) % 4 == i)*/){ + if(tile.entity.hasItem(item) && other != null && other.block().acceptItem(item, other, tile)){ other.block().handleItem(item, other, tile); tile.entity.removeItem(item, 1); tile.setDump((byte)((i+1)%4)); return true; } } + } i++; i %= 4; } diff --git a/core/src/io/anuke/mindustry/world/Tile.java b/core/src/io/anuke/mindustry/world/Tile.java index 1764ab7913..1c48410692 100644 --- a/core/src/io/anuke/mindustry/world/Tile.java +++ b/core/src/io/anuke/mindustry/world/Tile.java @@ -127,7 +127,7 @@ public class Tile{ } public void setRotation(byte rotation){ - data = Bits.packShort(rotation, getDump()); + data = Bits.packShort(rotation, Bits.getRightByte(data)); } public void setDump(byte dump){ diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java index 16b4de59d4..7d7e3f157a 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java @@ -120,7 +120,7 @@ public class Conveyor extends Block{ int direction = source == null ? 0 : Math.abs(source.relativeTo(dest.x, dest.y) - dest.getRotation()); float minitem = dest.entity().minitem; return (((direction == 0) && minitem > 0.05f) || - ((direction %2 == 1) && minitem > 0.52f)) && (source == null || !((source.getRotation() + 2) % 4 == dest.getRotation())); + ((direction %2 == 1) && minitem > 0.52f)) && (source == null || !(source.block().rotate && (source.getRotation() + 2) % 4 == dest.getRotation())); } @Override