Today I will be showing you how to fix the object offset bug in some map areas. This includes raids maps, roof top agility and the dungeoneering map entrance
Edited classes:
ObjectManager
1. Go into your ObjectManager and search for method175. Once at that method, you want to rename the following
int i --> int regionY
int k --> plane
int l --> regionX
aByteArrayArrayArray149 --> tileSettings
anIntArrayArrayArray129 --> tileHeights
anInt145 --> highestPlane
int k1 --> int a_y
int l1 --> int b_y
int i2 --> int d_y
int j2 --> int c_y
the start of your method should now look like:
Code:
if(plane < highestPlane)
highestPlane = plane;
int a_y = tileHeights[plane][regionX][regionY];
int b_y = tileHeights[plane][regionX + 1][regionY];
int d_y = tileHeights[plane][regionX + 1][regionY + 1];
int c_y = tileHeights[plane][regionX][regionY + 1];
int k2 = a_y + b_y + d_y + c_y >> 2;
ObjectDef class46 = ObjectDef.forID(i1);
int l2 = regionX + (regionY << 7) + ((i1 > 0x7fff ? i1 & 0x7fff : i1) << 14) + 0x40000000;
if(!class46.hasActions)
l2 += 0x80000000;
byte byte0 = (byte)((j1 << 6) + j);
2. Under:
Code:
if(plane < anInt145)
anInt145 = plane;
Add:
Code:
ObjectDef class46 = ObjectDef.forID(i1);
int size1;
int size2;
if (j1 == 1 || j1 == 3) {
size1 = class46.anInt761;//objectSizeY
size2 = class46.anInt744;//objectSizeX
} else {
size1 = class46.anInt744;
size2 = class46.anInt761;
}
int modX;
int modX1;
if (104 >= (size1 + regionX)) {
modX1 = regionX + (size1 + 1 >> 1);
modX = regionX + (size1 >> 1);
} else {
modX = regionX;
modX1 = regionX + 1;
}
int modY;
int modY1;
if (104>= (size2 + regionY)) {
modY1 = regionY + (size2 + 1 >> 1);
modY = (size2 >> 1) + regionY;
} else {
modY = regionY;
modY1 = 1 + regionY;
}
3.Under:
Code:
int k2 = a_y + b_y + d_y + c_y >> 2;
Remove the duplicate variable:
Code:
ObjectDef class46 = ObjectDef.forID(i1);
4. Replace the following:
Code:
int a_y = tileHeights[plane][regionX][regionY];
int b_y = tileHeights[plane][regionX + 1][regionY];
int d_y = tileHeights[plane][regionX + 1][regionY + 1];
int c_y = tileHeights[plane][regionX][regionY + 1];
with:
Code:
int a_y = tileHeights[plane][modX][modY];
int b_y = tileHeights[plane][modX1][modY];
int d_y = tileHeights[plane][modX1][modY1];
int c_y = tileHeights[plane][modX][modY1];
Osrs Before/After images:
667 Before/After:
Credits:
RedSixtySeven
Greg