mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-01-19 08:47:39 +07:00
Added entity interaction for non-zone entities
This commit is contained in:
parent
9d2b5e1494
commit
ad931e0e8e
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user