mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-25 22:58:47 +07:00
Fixed player begin able to mine near enemies
This commit is contained in:
parent
c7bc6e9128
commit
5d70b4b95b
@ -6,6 +6,7 @@ import io.anuke.annotations.Annotations.Loc;
|
||||
import io.anuke.annotations.Annotations.Remote;
|
||||
import io.anuke.mindustry.content.blocks.Blocks;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.mindustry.entities.effect.ItemDrop;
|
||||
import io.anuke.mindustry.entities.effect.ItemTransfer;
|
||||
import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest;
|
||||
@ -164,6 +165,7 @@ public abstract class InputHandler extends InputAdapter{
|
||||
return tile.floor().drops != null && tile.floor().drops.item.hardness <= player.mech.drillPower
|
||||
&& !tile.floor().playerUnmineable
|
||||
&& player.inventory.canAcceptItem(tile.floor().drops.item)
|
||||
&& Units.getClosestEnemy(player.getTeam(), tile.worldx(), tile.worldy(), 40f, e -> true) == null //don't being mining when an enemy is near
|
||||
&& tile.block() == Blocks.air && player.distanceTo(tile.worldx(), tile.worldy()) <= Player.mineDistance;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user