mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-12 16:58:05 +07:00
Added entity interaction for non-zone entities
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user