From 92764c8389c3e1c02d68ba12bdf88d96beb46de2 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 23 Aug 2020 09:40:06 -0400 Subject: [PATCH] Fixed #2408 --- core/src/mindustry/content/Blocks.java | 2 +- core/src/mindustry/content/UnitTypes.java | 20 +++++++++---------- core/src/mindustry/logic/LogicDialog.java | 2 +- .../world/blocks/logic/LogicBlock.java | 14 +++++++++++-- gradle.properties | 2 +- 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index ad1fd37c90..38021eeb0c 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -1923,7 +1923,7 @@ public class Blocks implements ContentList{ consumes.liquid(Liquids.cryofluid, 0.08f); hasLiquids = true; - instructionsPerTick = 15; + instructionsPerTick = 25; range = 8 * 40; diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 6351c93f23..3f6c36accb 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -534,7 +534,7 @@ public class UnitTypes implements ContentList{ rotateSpeed = 1.9f; flying = true; lowAltitude = true; - health = 8000; + health = 7000; armor = 9f; engineOffset = 21; engineSize = 5.3f; @@ -545,10 +545,10 @@ public class UnitTypes implements ContentList{ height = 8f; shrinkY = 0f; drag = -0.01f; - splashDamageRadius = 40f; - splashDamage = 40f; + splashDamageRadius = 20f; + splashDamage = 30f; ammoMultiplier = 4f; - lifetime = 80f; + lifetime = 50f; hitEffect = Fx.blastExplosion; despawnEffect = Fx.blastExplosion; @@ -583,17 +583,17 @@ public class UnitTypes implements ContentList{ y = 2f; x = 10f; shootY = 12f; - reload = 10; + reload = 12; shake = 1f; rotateSpeed = 2f; ejectEffect = Fx.shellEjectSmall; shootSound = Sounds.shootBig; rotate = true; occlusion = 8f; - bullet = new BasicBulletType(7f, 60){{ + bullet = new BasicBulletType(7f, 50){{ width = 12f; height = 18f; - lifetime = 30f; + lifetime = 25f; shootEffect = Fx.shootBig; }}; }} @@ -621,19 +621,19 @@ public class UnitTypes implements ContentList{ x = 18f; y = 5f; rotateSpeed = 2f; - reload = 50f; + reload = 45f; recoil = 4f; shootSound = Sounds.laser; occlusion = 20f; rotate = true; bullet = new LaserBulletType(){{ - damage = 75f; + damage = 80f; sideAngle = 20f; sideWidth = 1.5f; sideLength = 80f; width = 25f; - length = 200f; + length = 220f; shootEffect = Fx.shockwave; colors = new Color[]{Color.valueOf("ec7458aa"), Color.valueOf("ff9c5a"), Color.white}; }}; diff --git a/core/src/mindustry/logic/LogicDialog.java b/core/src/mindustry/logic/LogicDialog.java index daef141a29..f201c7535b 100644 --- a/core/src/mindustry/logic/LogicDialog.java +++ b/core/src/mindustry/logic/LogicDialog.java @@ -36,7 +36,7 @@ public class LogicDialog extends BaseDialog{ t.button("@schematic.copy.import", Icon.download, style, () -> { dialog.hide(); try{ - canvas.load(Core.app.getClipboardText()); + canvas.load(Core.app.getClipboardText().replace("\r\n", "\n")); }catch(Throwable e){ ui.showException(e); } diff --git a/core/src/mindustry/world/blocks/logic/LogicBlock.java b/core/src/mindustry/world/blocks/logic/LogicBlock.java index c677811b70..eed8e128c3 100644 --- a/core/src/mindustry/world/blocks/logic/LogicBlock.java +++ b/core/src/mindustry/world/blocks/logic/LogicBlock.java @@ -329,7 +329,9 @@ public class LogicBlock extends Block{ //check for previously invalid links to add after configuration boolean changed = false; - for(LogicLink l : links){ + for(int i = 0; i < links.size; i++){ + LogicLink l = links.get(i); + if(!l.active) continue; boolean valid = validLink(world.build(l.x, l.y)); @@ -337,10 +339,18 @@ public class LogicBlock extends Block{ changed = true; l.valid = valid; if(valid){ + Building lbuild = world.build(l.x, l.y); + //this prevents conflicts l.name = ""; //finds a new matching name after toggling - l.name = findLinkName(world.build(l.x, l.y).block); + l.name = findLinkName(lbuild.block); + + //remove redundant links + links.removeAll(o -> world.build(o.x, o.y) == lbuild && o != l); + + //break to prevent concurrent modification + break; } } } diff --git a/gradle.properties b/gradle.properties index 24396045bf..213f452ee6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=c26572df6b690a114702bac5af50d4fb72940b77 +archash=1040fdcbb5760e4c4a646d64782a25761efc1159