Correctly highlight ObjectClueScroll for single location
This is regression by PR that introduced 3 step cryptic clues, as check for highlighting single object was removed. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -314,18 +314,7 @@ public class ClueScrollPlugin extends Plugin
|
||||
{
|
||||
for (WorldPoint location : locations)
|
||||
{
|
||||
final LocalPoint localLocation = LocalPoint.fromWorld(client, location);
|
||||
|
||||
if (localLocation != null)
|
||||
{
|
||||
final Scene scene = client.getScene();
|
||||
final Tile[][][] tiles = scene.getTiles();
|
||||
final Tile tile = tiles[client.getPlane()][localLocation.getSceneX()][localLocation.getSceneY()];
|
||||
|
||||
objectsToMark = Arrays.stream(tile.getGameObjects())
|
||||
.filter(object -> object != null && ArrayUtils.contains(objectIds, object.getId()))
|
||||
.toArray(GameObject[]::new);
|
||||
}
|
||||
highlightObjectsForLocation(location, objectIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -346,6 +335,16 @@ public class ClueScrollPlugin extends Plugin
|
||||
}
|
||||
|
||||
addMapPoints(location);
|
||||
|
||||
if (clue instanceof ObjectClueScroll)
|
||||
{
|
||||
int[] objectIds = ((ObjectClueScroll) clue).getObjectIds();
|
||||
|
||||
if (objectIds.length > 0)
|
||||
{
|
||||
highlightObjectsForLocation(location, objectIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -582,6 +581,24 @@ public class ClueScrollPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
private void highlightObjectsForLocation(final WorldPoint location, final int... objectIds)
|
||||
{
|
||||
final LocalPoint localLocation = LocalPoint.fromWorld(client, location);
|
||||
|
||||
if (localLocation == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Scene scene = client.getScene();
|
||||
final Tile[][][] tiles = scene.getTiles();
|
||||
final Tile tile = tiles[client.getPlane()][localLocation.getSceneX()][localLocation.getSceneY()];
|
||||
|
||||
objectsToMark = Arrays.stream(tile.getGameObjects())
|
||||
.filter(object -> object != null && ArrayUtils.contains(objectIds, object.getId()))
|
||||
.toArray(GameObject[]::new);
|
||||
}
|
||||
|
||||
private void checkClueNPCs(ClueScroll clue, final NPC... npcs)
|
||||
{
|
||||
if (!(clue instanceof NpcClueScroll))
|
||||
|
||||
Reference in New Issue
Block a user