From 59ca257cca78b6845cb07b2d55802261ef666a3c Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 11 Nov 2022 15:08:38 -0500 Subject: [PATCH] Fixed #7874 --- core/assets/bundles/bundle.properties | 2 +- core/src/mindustry/content/Blocks.java | 3 +++ core/src/mindustry/core/NetServer.java | 8 ++++++++ .../mindustry/world/blocks/defense/turrets/Turret.java | 4 +++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 7dd9c7980d..43c8f2cfab 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1803,7 +1803,7 @@ gz.duoammo = Supply the Duo turrets with [accent]copper[], using conveyors. gz.walls = [accent]Walls[] can prevent oncoming damage from reaching buildings.\nPlace \uf8ae [accent]copper walls[] around the turrets. gz.defend = Enemy incoming, prepare to defend. gz.aa = Flying units cannot easily be dispatched with standard turrets.\n\uf860 [accent]Scatter[] turrets provide excellent anti-air, but require \uf837 [accent]lead[] as ammo. -gz.scatterammo = Supply the Scatter turret with [accent]lead[], using conveyors. +gz.scatterammo = Supply the Scatter turret with \uf837 [accent]lead[], using conveyors. gz.supplyturret = [accent]Supply Turret gz.zone1 = This is the enemy drop zone. gz.zone2 = Anything built in the radius is destroyed when a wave starts. diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index b6da7a57ba..19025fc241 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -3956,6 +3956,7 @@ public class Blocks{ coolantMultiplier = 6f; shootSound = Sounds.shootAlt; + targetUnderBlocks = false; shake = 1f; ammoPerShot = 2; drawer = new DrawTurret("reinforced-"); @@ -4006,6 +4007,7 @@ public class Blocks{ ammoPerShot = 3; maxAmmo = 30; consumeAmmoOnce = true; + targetUnderBlocks = false; shootSound = Sounds.shootAltLong; @@ -4606,6 +4608,7 @@ public class Blocks{ minWarmup = 0.94f; shootWarmupSpeed = 0.03f; targetAir = false; + targetUnderBlocks = false; shake = 6f; ammoPerShot = 20; diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index f949cece22..b5b285d0bf 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -226,6 +226,14 @@ public class NetServer implements ApplicationListener{ con.kick(KickReason.idInUse); return; } + + for(var otherCon : net.getConnections()){ + if(otherCon != con && uuid.equals(otherCon.uuid)){ + con.uuid = packet.uuid; + con.kick(KickReason.idInUse); + return; + } + } } packet.name = fixName(packet.name); diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index 326a4c2a10..2209cb640c 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -81,12 +81,14 @@ public class Turret extends ReloadTurret{ public boolean playerControllable = true; /** If true, this block will display ammo multipliers in its stats (irrelevant for certain types of turrets). */ public boolean displayAmmoMultiplier = true; + /** If false, 'under' blocks like conveyors are not targeted. */ + public boolean targetUnderBlocks = true; /** Function for choosing which unit to target. */ public Sortf unitSort = UnitSorts.closest; /** Filter for types of units to attack. */ public Boolf unitFilter = u -> true; /** Filter for types of buildings to attack. */ - public Boolf buildingFilter = b -> !b.block.underBullets; + public Boolf buildingFilter = b -> targetUnderBlocks || !b.block.underBullets; /** Color of heat region drawn on top (if found) */ public Color heatColor = Pal.turretHeat;