Skip to content

Commit

Permalink
Fix proc highlight triggering when hiding units / hiding air units
Browse files Browse the repository at this point in the history
  • Loading branch information
BalaM314 committed Dec 24, 2023
1 parent b630b8a commit 77cedfe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/mindustry/graphics/OverlayRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public void drawTop(){

input.drawOverSelect();

if(ui.hudfrag.blockfrag.hover() instanceof Unit unit && unit.controller() instanceof LogicAI ai && ai.controller != null && ai.controller.isValid()){
if(ui.hudfrag.blockfrag.hover() instanceof Unit unit && unit.controller() instanceof LogicAI ai && ai.controller != null && ai.controller.isValid() && !hidingUnits && !(hidingAirUnits && unit.isFlying())){
var build = ai.controller;
Drawf.square(build.x, build.y, build.block.size * tilesize/2f + 2f);
if (Core.settings.getBool("tracelogicunits")) build.drawSelect();
Expand Down
2 changes: 1 addition & 1 deletion core/src/mindustry/world/blocks/logic/LogicBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ public void drawConfigure(){

@Override
public void drawSelect(){
Groups.unit.each(u -> u.controller() instanceof LogicAI ai && ai.controller == this, unit -> {
Groups.unit.each(u -> u.controller() instanceof LogicAI ai && ai.controller == this && !ClientVars.hidingUnits && !(ClientVars.hidingAirUnits && u.isFlying()), unit -> {
Drawf.square(unit.x, unit.y, unit.hitSize, unit.rotation + 45);
if (Core.settings.getBool("tracelogicunits")) {
Draw.draw((float) (Layer.overlayUI+0.01), () -> { // Taken from extended-UI
Expand Down

0 comments on commit 77cedfe

Please sign in to comment.