diff --git a/Server/src/main/core/net/packet/out/ClearRegionChunk.java b/Server/src/main/core/net/packet/out/ClearRegionChunk.java index f94a7a4df..77fe6456c 100644 --- a/Server/src/main/core/net/packet/out/ClearRegionChunk.java +++ b/Server/src/main/core/net/packet/out/ClearRegionChunk.java @@ -1,6 +1,7 @@ package core.net.packet.out; import core.game.world.map.Location; +import core.game.world.update.MapChunkRenderer; import core.net.packet.IoBuffer; import core.net.packet.OutgoingPacket; import core.net.packet.context.ClearChunkContext; @@ -10,13 +11,14 @@ import core.net.packet.context.ClearChunkContext; * @author Emperor */ public final class ClearRegionChunk implements OutgoingPacket { + static final int buildAreaDepth = MapChunkRenderer.buildAreaDepth; @Override public void send(ClearChunkContext context) { Location l = context.getPlayer().getPlayerFlags().getLastSceneGraph(); int x = context.getChunk().getCurrentBase().getSceneX(l); int y = context.getChunk().getCurrentBase().getSceneY(l); - if (x >= 0 && y >= 0 && x < 96 && y < 96) { + if (x >= 0 && y >= 0 && x < buildAreaDepth && y < buildAreaDepth) { IoBuffer buffer = new IoBuffer(112).put(x).putC(y); buffer.cypherOpcode(context.getPlayer().getSession().getIsaacPair().getOutput());context.getPlayer().getSession().write(buffer); }