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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user