From 956cbe792b0a88e6f0006311a67048ba9cf68937 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 15 Oct 2021 18:48:59 -0400 Subject: [PATCH] Fixed #6164 --- core/src/mindustry/logic/LExecutor.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/core/src/mindustry/logic/LExecutor.java b/core/src/mindustry/logic/LExecutor.java index 8baa4fb693..01e6782497 100644 --- a/core/src/mindustry/logic/LExecutor.java +++ b/core/src/mindustry/logic/LExecutor.java @@ -431,17 +431,16 @@ public class LExecutor{ Call.pickedUnitPayload(unit, result); } }else{ //buildings - Building tile = world.buildWorld(unit.x, unit.y); + Building build = world.buildWorld(unit.x, unit.y); //TODO copy pasted code - if(tile != null && tile.team == unit.team){ - if(tile.block.buildVisibility != BuildVisibility.hidden && tile.canPickup() && pay.canPickup(tile)){ - Call.pickedBuildPayload(unit, tile, true); - }else{ //pick up block payload - Payload current = tile.getPayload(); - if(current != null && pay.canPickupPayload(current)){ - Call.pickedBuildPayload(unit, tile, false); - } + if(build != null && build.team == unit.team){ + Payload current = build.getPayload(); + if(current != null && pay.canPickupPayload(current)){ + Call.pickedBuildPayload(unit, build, false); + //pick up whole building directly + }else if(build.block.buildVisibility != BuildVisibility.hidden && build.canPickup() && pay.canPickup(build)){ + Call.pickedBuildPayload(unit, build, true); } } }