From 45825b8a3d76aad501a72924b2386e5ea9a59ead Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Sat, 29 Aug 2020 02:06:52 -0700 Subject: [PATCH] Removed hovered target id code into getHovered(int) --- .../riiablo/engine/client/CursorMovementSystem.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/src/com/riiablo/engine/client/CursorMovementSystem.java b/core/src/com/riiablo/engine/client/CursorMovementSystem.java index 5853b4a3..3926ad54 100644 --- a/core/src/com/riiablo/engine/client/CursorMovementSystem.java +++ b/core/src/com/riiablo/engine/client/CursorMovementSystem.java @@ -140,10 +140,15 @@ public class CursorMovementSystem extends BaseSystem { } } - private boolean touchDown(int src) { + private int getHovered(int src) { IntBag hoveredEntities = hoveredSubscriber.getEntities(); - if (hoveredEntities.size() == 0) return false; - int target = hoveredEntities.get(0); + if (hoveredEntities.size() == 0) return Engine.INVALID_ENTITY; + return hoveredEntities.get(0); + } + + private boolean touchDown(int src) { + int target = getHovered(src); + if (target == Engine.INVALID_ENTITY) return false; setTarget(src, target); return true; }