From c23e499c92cd4e82e47dd9bbff05e027d53e43bf Mon Sep 17 00:00:00 2001 From: Hydrox6 Date: Thu, 30 Dec 2021 01:59:48 +0000 Subject: [PATCH] roof removal: use worldpoint's plane instead of current plane This allows for overrides on template chunks to be defined based on the chunk's position, not where the chunk ends up in the scene. I think this only really matters for the POH, which stores each style across all 4 planes of 3 (or 7) regions. --- .../client/plugins/roofremoval/RoofRemovalPlugin.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/roofremoval/RoofRemovalPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/roofremoval/RoofRemovalPlugin.java index 9f86d9a47e..d9d711ab41 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/roofremoval/RoofRemovalPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/roofremoval/RoofRemovalPlugin.java @@ -250,15 +250,15 @@ public class RoofRemovalPlugin extends Plugin // Properly account for instances shifting worldpoints around final WorldPoint wp = WorldPoint.fromLocalInstance(client, tile.getLocalLocation(), tile.getPlane()); - int regionID = wp.getRegionID() << 2 | z; - if (!overrides.containsKey(regionID)) + int regionAndPlane = wp.getRegionID() << 2 | wp.getPlane(); + if (!overrides.containsKey(regionAndPlane)) { continue; } int rx = wp.getRegionX(); int ry = wp.getRegionY(); - long[] region = overrides.get(regionID); + long[] region = overrides.get(regionAndPlane); if ((region[ry] & (1L << rx)) != 0) { settings[z][x][y] |= Constants.TILE_FLAG_UNDER_ROOF;