From ad931e0e8ec63a7bbe6bb011f49f4f177bdb4da9 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Mon, 11 Mar 2019 02:07:18 -0700 Subject: [PATCH] Added entity interaction for non-zone entities --- core/src/com/riiablo/map/MapListener.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/com/riiablo/map/MapListener.java b/core/src/com/riiablo/map/MapListener.java index fcf28cd8..dea4ed13 100644 --- a/core/src/com/riiablo/map/MapListener.java +++ b/core/src/com/riiablo/map/MapListener.java @@ -59,6 +59,18 @@ public class MapListener { } } } + for (Entity entity : gameScreen.entities.values()) { + if (entity.isOver()) { + if (entity.position().dst(gameScreen.player.position()) <= entity.getInteractRange()) { + setTarget(null); + entity.interact(gameScreen); + } else { + setTarget(entity); + } + + return true; + } + } return false; }