From 0350e6bbf4bf7bd7596322ba598d5dd1b989cc94 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 11 Feb 2021 12:03:11 -0500 Subject: [PATCH] Validate teams with power links --- core/src/mindustry/entities/comp/BuildingComp.java | 3 ++- .../world/blocks/defense/turrets/TractorBeamTurret.java | 2 +- core/src/mindustry/world/blocks/units/RepairPoint.java | 2 +- gradle.properties | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index b368d060e0..f270929f3a 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -792,6 +792,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, for(Building other : proximity){ if(other != null && other.power != null + && other.team == team && !(block.consumesPower && other.block.consumesPower && !block.outputsPower && !other.block.outputsPower) && conductsTo(other) && other.conductsTo(self()) && !power.links.contains(other.pos())){ out.add(other); @@ -800,7 +801,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, for(int i = 0; i < power.links.size; i++){ Tile link = world.tile(power.links.get(i)); - if(link != null && link.build != null && link.build.power != null) out.add(link.build); + if(link != null && link.build != null && link.build.power != null && link.build.team == team) out.add(link.build); } return out; } diff --git a/core/src/mindustry/world/blocks/defense/turrets/TractorBeamTurret.java b/core/src/mindustry/world/blocks/defense/turrets/TractorBeamTurret.java index a56d648b3d..a7a94a4ad1 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/TractorBeamTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/TractorBeamTurret.java @@ -98,7 +98,7 @@ public class TractorBeamTurret extends BaseTurret{ any = false; //look at target - if(target != null && target.within(this, range) && target.team() != team && target.checkTarget(targetAir, targetGround) && efficiency() > 0.02f){ + if(target != null && target.within(this, range + target.hitSize/2f) && target.team() != team && target.checkTarget(targetAir, targetGround) && efficiency() > 0.02f){ if(!headless){ control.sound.loop(shootSound, this, shootSoundVolume); } diff --git a/core/src/mindustry/world/blocks/units/RepairPoint.java b/core/src/mindustry/world/blocks/units/RepairPoint.java index 80664cbee3..72e0f506d2 100644 --- a/core/src/mindustry/world/blocks/units/RepairPoint.java +++ b/core/src/mindustry/world/blocks/units/RepairPoint.java @@ -95,7 +95,7 @@ public class RepairPoint extends Block{ @Override public void updateTile(){ boolean targetIsBeingRepaired = false; - if(target != null && (target.dead() || target.dst(tile) > repairRadius || target.health() >= target.maxHealth())){ + if(target != null && (target.dead() || target.dst(tile) - target.hitSize/2f > repairRadius || target.health() >= target.maxHealth())){ target = null; }else if(target != null && consValid()){ target.heal(repairSpeed * Time.delta * strength * efficiency()); diff --git a/gradle.properties b/gradle.properties index 88888d07c9..67ecd167b9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=5b04a94d53e279e3af3a2654978fff5ab16e7cb8 +archash=d23d0f0b3625ab2d7d97e6c89a773ab6a4ad8434