Hello,
I've been trying to remove the clipping from an object I removed in the server.
Here is a screenshot of an npc that I attacked and can't walk through the removed object:
This is what I tried:
In the loadCustomSpawns method I added this line:
Code:
c.getPA().checkObjectSpawn(-1, 3088, 3509, 0, 10);
This will get rid of the object.
Then in the checkObjectSpawn method I added this:
Code:
if (objectId != -1)
Region.addObject(objectId, objectX, objectY, 0, objectType, face);
else
Region.removeClipping(objectX, objectY, 0);
This is my removeClipping and removeClip method:
Code:
private void removeClip(int x, int y, int height) {
int regionAbsX = (id >> 8) * 64;
int regionAbsY = (id & 0xff) * 64;
if (clips[(int)height] == null) {
clips[(int)height] = new int[64][64];
}
clips[(int)height][x - regionAbsX][y - regionAbsY] = 0;
}
public static void removeClipping(int x, int y, int height) {
int regionX = x >> 3;
int regionY = y >> 3;
int regionId = ((regionX / 8) << 8) + (regionY / 8);
//System.out.println("X: "+regionX+" - Y: "+regionY+" - id: "+regionId);
for (Region r : regions) {
if (r.id() == regionId) {
r.removeClip(x, y, height);
break;
}
}
}