From a89d50e74d5b547081e354b48e3f04d5e9dac305 Mon Sep 17 00:00:00 2001 From: MEEP of Faith <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 2 Mar 2021 06:25:15 -0800 Subject: [PATCH] Cursor should not change for other teams when hovering over doors and construction. (#4838) * Cursor should not change for other teams. * Use Built-in interaction check Co-authored-by: Patrick 'Quezler' Mounier * Building should use built-in check, same treatment for ConstructBlock Co-authored-by: Patrick 'Quezler' Mounier --- core/src/mindustry/entities/comp/BuildingComp.java | 2 +- core/src/mindustry/world/blocks/ConstructBlock.java | 2 +- core/src/mindustry/world/blocks/defense/Door.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 3495255ded..dfa7fd75cc 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -1142,7 +1142,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, /** Returns whether or not a hand cursor should be shown over this block. */ public Cursor getCursor(){ - return block.configurable && team == player.team() ? SystemCursor.hand : SystemCursor.arrow; + return block.configurable && interactable(player.team()) ? SystemCursor.hand : SystemCursor.arrow; } /** diff --git a/core/src/mindustry/world/blocks/ConstructBlock.java b/core/src/mindustry/world/blocks/ConstructBlock.java index 85ca209ab6..b9621fe736 100644 --- a/core/src/mindustry/world/blocks/ConstructBlock.java +++ b/core/src/mindustry/world/blocks/ConstructBlock.java @@ -172,7 +172,7 @@ public class ConstructBlock extends Block{ @Override public Cursor getCursor(){ - return SystemCursor.hand; + return interactable(player.team()) ? SystemCursor.hand : SystemCursor.arrow; } @Override diff --git a/core/src/mindustry/world/blocks/defense/Door.java b/core/src/mindustry/world/blocks/defense/Door.java index f17ca43946..a1d84a7595 100644 --- a/core/src/mindustry/world/blocks/defense/Door.java +++ b/core/src/mindustry/world/blocks/defense/Door.java @@ -126,7 +126,7 @@ public class Door extends Wall{ @Override public Cursor getCursor(){ - return SystemCursor.hand; + return interactable(player.team()) ? SystemCursor.hand : SystemCursor.arrow; } @Override