mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-25 12:25:14 -06:00
Correct too narrow guards for clear region chunk
This commit is contained in:
parent
4d9243884f
commit
3edce27449
1 changed files with 3 additions and 1 deletions
|
|
@ -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<ClearChunkContext> {
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue