diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index 68e2403d1a..79e12d9987 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -132,6 +132,8 @@ public class Renderer extends RendererModule{ @Override public void update(){ + //TODO hack, find source of this bug + Color.WHITE.set(1f, 1f, 1f, 1f); if(Core.cameraScale != targetscale){ float targetzoom = (float) Core.cameraScale / targetscale; diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index d8684f8095..602d6f748b 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -441,6 +441,13 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra public void update(){ hitTime = Math.max(0f, hitTime - Timers.delta()); + if(Float.isNaN(x) || Float.isNaN(y)){ + TileEntity core = getClosestCore(); + if(core != null){ + set(core.x, core.y); + } + } + if(isDead()){ isBoosting = false; boostHeat = 0f; diff --git a/core/src/io/anuke/mindustry/entities/effect/Puddle.java b/core/src/io/anuke/mindustry/entities/effect/Puddle.java index 214e003777..f3b2df91aa 100644 --- a/core/src/io/anuke/mindustry/entities/effect/Puddle.java +++ b/core/src/io/anuke/mindustry/entities/effect/Puddle.java @@ -179,7 +179,7 @@ public class Puddle extends BaseEntity implements SaveTrait, Poolable, DrawTrait float deposited = Math.min((amount - maxLiquid / 1.5f) / 4f, 0.3f) * Timers.delta(); for(GridPoint2 point : Geometry.d4){ Tile other = world.tile(tile.x + point.x, tile.y + point.y); - if(other.block() == Blocks.air && !other.hasCliffs()){ + if(other != null && other.block() == Blocks.air && !other.hasCliffs()){ deposit(other, tile, liquid, deposited, generation + 1); amount -= deposited / 2f; //tweak to speed up/slow down puddle propagation } diff --git a/core/src/io/anuke/mindustry/io/TypeIO.java b/core/src/io/anuke/mindustry/io/TypeIO.java index c4c60d145c..0fe0887096 100644 --- a/core/src/io/anuke/mindustry/io/TypeIO.java +++ b/core/src/io/anuke/mindustry/io/TypeIO.java @@ -105,7 +105,7 @@ public class TypeIO{ @WriteClass(CarryTrait.class) public static void writeCarry(ByteBuffer buffer, CarryTrait unit){ - if(unit == null){ + if(unit == null || unit.getGroup() == null){ buffer.put((byte) -1); return; } diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java index 16e178f254..c3407ec336 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java @@ -65,13 +65,13 @@ public class BlocksFragment extends Fragment{ //add top description table descTable = new Table("button"); - descTable.visible(() -> hoverRecipe != null || input.recipe != null); //make sure it's visible when necessary + descTable.visible(() -> (hoverRecipe != null || input.recipe != null) && shown); //make sure it's visible when necessary descTable.update(() -> { // note: This is required because there is no direct connection between input.recipe and the description ui. // If input.recipe gets set to null, a proper cleanup of the ui elements is required. boolean anyRecipeShown = input.recipe != null || hoverRecipe != null; boolean descriptionTableClean = descTable.getChildren().size == 0; - boolean cleanupRequired = !anyRecipeShown && !descriptionTableClean; + boolean cleanupRequired = (!anyRecipeShown && !descriptionTableClean); if(cleanupRequired){ descTable.clear(); } diff --git a/core/src/io/anuke/mindustry/world/blocks/production/GenericCrafter.java b/core/src/io/anuke/mindustry/world/blocks/production/GenericCrafter.java index f6c796174a..b326270a01 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/GenericCrafter.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/GenericCrafter.java @@ -81,7 +81,7 @@ public class GenericCrafter extends Block{ public void update(Tile tile){ GenericCrafterEntity entity = tile.entity(); - if(entity.cons.valid()){ + if(entity.cons.valid() && tile.entity.items.get(output) < itemCapacity){ entity.progress += 1f / craftTime * Timers.delta(); entity.totalProgress += Timers.delta();