diff --git a/core/src/mindustry/entities/Puddles.java b/core/src/mindustry/entities/Puddles.java index 3b9f02c75c..461e486001 100644 --- a/core/src/mindustry/entities/Puddles.java +++ b/core/src/mindustry/entities/Puddles.java @@ -83,7 +83,7 @@ public class Puddles{ (liquid.flammability > 0.3f && dest.temperature > 0.7f)){ //flammable liquid + hot liquid Fires.create(tile); if(Mathf.chance(0.006 * amount)){ - Call.createBullet(Bullets.fireball, Team.derelict, x, y, Mathf.random(360f), -1f, 1f, 1f); + Bullets.fireball.createNet(Team.derelict, x, y, Mathf.random(360f), -1f, 1f, 1f); } }else if(dest.temperature > 0.7f && liquid.temperature < 0.55f){ //cold liquid poured onto hot Puddle if(Mathf.chance(0.5f * amount)){ diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 32056fbf6e..226cc10583 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -270,7 +270,7 @@ public abstract class BulletType extends Content{ } public void createNet(Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl){ - Call.createBullet(this, team, x, y, damage, angle, velocityScl, lifetimeScl); + Call.createBullet(this, team, x, y, angle, damage, velocityScl, lifetimeScl); } @Remote(called = Loc.server, unreliable = true) diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 4fb01dd60c..20693b378b 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -1070,6 +1070,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, return true; } + public boolean canPickup(){ + return true; + } + public void removeFromProximity(){ onProximityRemoved(); tmpTiles.clear(); diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 3d15d3e683..84861cf569 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -126,7 +126,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ if(tile != null && tile.team() == unit.team && pay.payloads().size < unit.type().payloadCapacity && unit.within(tile, tilesize * tile.block.size * 1.2f)){ //pick up block directly - if(tile.block().buildVisibility != BuildVisibility.hidden && tile.block().size <= 2){ + if(tile.block().buildVisibility != BuildVisibility.hidden && tile.block().size <= 2 && tile.canPickup()){ pay.pickup(tile); }else{ //pick up block payload Payload current = tile.getPayload(); diff --git a/core/src/mindustry/world/blocks/defense/Door.java b/core/src/mindustry/world/blocks/defense/Door.java index e4d7ae0cae..5c750156a5 100644 --- a/core/src/mindustry/world/blocks/defense/Door.java +++ b/core/src/mindustry/world/blocks/defense/Door.java @@ -84,7 +84,7 @@ public class Door extends Wall{ if(type == LAccess.enabled){ boolean shouldOpen = !Mathf.zero(p1); - if(open == shouldOpen || (Units.anyEntities(tile) && !shouldOpen) || !timer(timerToggle, 60f)){ + if(open == shouldOpen || (Units.anyEntities(tile) && !shouldOpen) || !origin().timer(timerToggle, 60f)){ return; } @@ -92,6 +92,10 @@ public class Door extends Wall{ } } + public DoorBuild origin(){ + return chained.isEmpty() ? this : chained.first(); + } + public void effect(){ (open ? closefx : openfx).at(this); } @@ -130,7 +134,7 @@ public class Door extends Wall{ @Override public void tapped(Player player){ - if((Units.anyEntities(tile) && open) || !timer(timerToggle, 40f)){ + if((Units.anyEntities(tile) && open) || !origin().timer(timerToggle, 50f)){ return; } diff --git a/core/src/mindustry/world/blocks/logic/LogicDisplay.java b/core/src/mindustry/world/blocks/logic/LogicDisplay.java index 4ad633cad6..ee3d53707a 100644 --- a/core/src/mindustry/world/blocks/logic/LogicDisplay.java +++ b/core/src/mindustry/world/blocks/logic/LogicDisplay.java @@ -43,12 +43,14 @@ public class LogicDisplay extends Block{ public void draw(){ super.draw(); - if(buffer == null){ - buffer = new FrameBuffer(displaySize, displaySize); - //clear the buffer - some OSs leave garbage in it - buffer.begin(Pal.darkerMetal); - buffer.end(); - } + Draw.draw(Draw.z(), () -> { + if(buffer == null){ + buffer = new FrameBuffer(displaySize, displaySize); + //clear the buffer - some OSs leave garbage in it + buffer.begin(Pal.darkerMetal); + buffer.end(); + } + }); if(!commands.isEmpty()){ Draw.draw(Draw.z(), () -> { @@ -86,7 +88,11 @@ public class LogicDisplay extends Block{ }); } - Draw.rect(Draw.wrap(buffer.getTexture()), x, y, buffer.getWidth() * Draw.scl, -buffer.getHeight() * Draw.scl); + Draw.draw(Draw.z(), () -> { + if(buffer != null){ + Draw.rect(Draw.wrap(buffer.getTexture()), x, y, buffer.getWidth() * Draw.scl, -buffer.getHeight() * Draw.scl); + } + }); } } diff --git a/core/src/mindustry/world/blocks/storage/StorageBlock.java b/core/src/mindustry/world/blocks/storage/StorageBlock.java index a6bc88cefc..639cb8b51f 100644 --- a/core/src/mindustry/world/blocks/storage/StorageBlock.java +++ b/core/src/mindustry/world/blocks/storage/StorageBlock.java @@ -39,5 +39,10 @@ public abstract class StorageBlock extends Block{ linkedCore.drawSelect(); } } + + @Override + public boolean canPickup(){ + return linkedCore != null; + } } }