Final commit

This commit is contained in:
psyopcutie 2026-05-09 11:30:20 +02:00
parent a7c7dea3c7
commit d29dd6f1b7
10 changed files with 1070 additions and 100 deletions

View file

@ -5,6 +5,7 @@ import org.openrs2.deob.annotation.OriginalArg;
import org.openrs2.deob.annotation.OriginalClass;
import org.openrs2.deob.annotation.OriginalMember;
import org.openrs2.deob.annotation.Pc;
import plugin.api.API;
import java.nio.ByteBuffer;
@ -972,7 +973,9 @@ public final class GlModel extends Model {
local161 = MathUtils.sin[arg0];
local163 = MathUtils.cos[arg0];
}
if (arg8 > 0L && RawModel.allowInput && local70 > 0) {
@Pc(165) boolean roofVisibilityLocPick = API.IsRoofVisibilityLocPickable(arg8);
@Pc(168) boolean miniMenuPick = arg8 > 0L;
if ((miniMenuPick || roofVisibilityLocPick) && RawModel.allowInput && local70 > 0) {
@Pc(187) int local187;
@Pc(191) int local191;
if (local84 > 0) {
@ -1046,63 +1049,79 @@ public final class GlModel extends Model {
}
if (anInt3582 >= local187 && anInt3582 <= local191 && RawModel.anInt1053 >= local206 && RawModel.anInt1053 <= local210) {
if (this.pickable) {
Model.aLongArray11[MiniMenu.anInt7++] = arg8;
} else {
if (anIntArray468.length < this.anInt5296) {
anIntArray468 = new int[this.anInt5296];
anIntArray467 = new int[this.anInt5296];
if (miniMenuPick) {
Model.aLongArray11[MiniMenu.anInt7++] = arg8;
}
local362 = 0;
label118:
while (true) {
if (local362 >= this.vertexCount) {
local362 = 0;
while (true) {
if (local362 >= this.triangleCount) {
break label118;
if (roofVisibilityLocPick) {
API.ReportRoofVisibilityLoc(arg8, arg9);
}
} else {
if (this.vertexX == null || this.vertexY == null || this.vertexZ == null || this.anIntArray462 == null || this.aShortArray81 == null) {
if (roofVisibilityLocPick) {
API.ReportRoofVisibilityLoc(arg8, arg9);
}
} else {
if (anIntArray468.length < this.anInt5296) {
anIntArray468 = new int[this.anInt5296];
anIntArray467 = new int[this.anInt5296];
}
local362 = 0;
label118:
while (true) {
if (local362 >= this.vertexCount) {
local362 = 0;
while (true) {
if (local362 >= this.triangleCount) {
break label118;
}
@Pc(698) short local698 = this.aShortArray77[local362];
@Pc(703) short local703 = this.aShortArray82[local362];
@Pc(708) short local708 = this.aShortArray83[local362];
if (this.method4118(anInt3582, RawModel.anInt1053, anIntArray467[local698], anIntArray467[local703], anIntArray467[local708], anIntArray468[local698], anIntArray468[local703], anIntArray468[local708])) {
if (miniMenuPick) {
Model.aLongArray11[MiniMenu.anInt7++] = arg8;
}
if (roofVisibilityLocPick) {
API.ReportRoofVisibilityLoc(arg8, arg9);
}
break label118;
}
local362++;
}
@Pc(698) short local698 = this.aShortArray77[local362];
@Pc(703) short local703 = this.aShortArray82[local362];
@Pc(708) short local708 = this.aShortArray83[local362];
if (this.method4118(anInt3582, RawModel.anInt1053, anIntArray467[local698], anIntArray467[local703], anIntArray467[local708], anIntArray468[local698], anIntArray468[local703], anIntArray468[local708])) {
Model.aLongArray11[MiniMenu.anInt7++] = arg8;
break label118;
}
local362++;
}
}
local369 = this.vertexX[local362];
local373 = this.vertexY[local362];
local377 = this.vertexZ[local362];
if (arg0 != 0) {
local389 = local377 * local161 + local369 * local163 >> 16;
local377 = local377 * local163 - local369 * local161 >> 16;
local369 = this.vertexX[local362];
local373 = this.vertexY[local362];
local377 = this.vertexZ[local362];
if (arg0 != 0) {
local389 = local377 * local161 + local369 * local163 >> 16;
local377 = local377 * local163 - local369 * local161 >> 16;
local369 = local389;
}
local369 += arg5;
local373 += arg6;
local377 += arg7;
local389 = local377 * arg3 + local369 * arg4 >> 16;
local377 = local377 * arg4 - local369 * arg3 >> 16;
local369 = local389;
}
local369 += arg5;
local373 += arg6;
local377 += arg7;
local389 = local377 * arg3 + local369 * arg4 >> 16;
local377 = local377 * arg4 - local369 * arg3 >> 16;
local369 = local389;
local389 = local373 * arg2 - local377 * arg1 >> 16;
local377 = local373 * arg1 + local377 * arg2 >> 16;
if (local377 < 50) {
break;
}
local465 = (local369 << 9) / local377;
local471 = (local389 << 9) / local377;
@Pc(652) int local652 = this.anIntArray462[local362];
@Pc(659) int local659 = this.anIntArray462[local362 + 1];
for (@Pc(661) int local661 = local652; local661 < local659; local661++) {
@Pc(671) int local671 = this.aShortArray81[local661] - 1;
if (local671 == -1) {
local389 = local373 * arg2 - local377 * arg1 >> 16;
local377 = local373 * arg1 + local377 * arg2 >> 16;
if (local377 < 50) {
break;
}
anIntArray468[local671] = local465;
anIntArray467[local671] = local471;
local465 = (local369 << 9) / local377;
local471 = (local389 << 9) / local377;
@Pc(652) int local652 = this.anIntArray462[local362];
@Pc(659) int local659 = this.anIntArray462[local362 + 1];
for (@Pc(661) int local661 = local652; local661 < local659; local661++) {
@Pc(671) int local671 = this.aShortArray81[local661] - 1;
if (local671 == -1) {
break;
}
anIntArray468[local671] = local465;
anIntArray467[local671] = local471;
}
local362++;
}
local362++;
}
}
}

View file

@ -606,11 +606,17 @@ public class MiniMenu {
}
if (actionCode == WALK_HERE) {
if (local36 == 0) {
if (API.IsRoofVisibilityActive()) {
API.ClearDestinationRoofTarget();
}
method3556(Player.plane, local15, local19);
} else if (local36 == 1) {
if (LoginManager.staffModLevel > 0 && Keyboard.pressedKeys[Keyboard.KEY_CTRL] && Keyboard.pressedKeys[Keyboard.KEY_SHIFT]) {
Cheat.teleport(Camera.originX + local15, Camera.originZ + local19, Player.plane);
} else if (PathFinder.findPath(PlayerList.self.movementQueueZ[0], 0, 0, true, 0, local15, 0, 0, 1, local19, PlayerList.self.movementQueueX[0])) {
if (API.IsRoofVisibilityActive()) {
API.SetDestinationRoofTarget(local15, local19);
}
Protocol.outboundBuffer.p1(InterfaceList.anInt5);
Protocol.outboundBuffer.p1(anInt2878);
Protocol.outboundBuffer.p2((int) Camera.yawTarget);

View file

@ -4,6 +4,7 @@ import com.jogamp.opengl.GL2;
import org.openrs2.deob.annotation.OriginalArg;
import org.openrs2.deob.annotation.OriginalMember;
import org.openrs2.deob.annotation.Pc;
import plugin.api.API;
public class SceneGraph {
@ -1744,7 +1745,7 @@ public class SceneGraph {
}
if (local153.plainTile == null) {
if (local153.shapedTile != null) {
method2762(local153.shapedTile, anInt2886, anInt3038, anInt5205, anInt2222, local18, local21, method187(0, local18, local21));
method2762(local153.shapedTile, anInt2886, anInt3038, anInt5205, anInt2222, local18, local21, 0, method187(0, local18, local21));
}
} else
method2610(local153.plainTile, 0, anInt2886, anInt3038, anInt5205, anInt2222, local18, local21, method187(0, local18, local21));
@ -1776,10 +1777,10 @@ public class SceneGraph {
if (local8.plainTile == null) {
if (local8.shapedTile != null) {
if (method187(local27, local18, local21)) {
method2762(local8.shapedTile, anInt2886, anInt3038, anInt5205, anInt2222, local18, local21, true);
method2762(local8.shapedTile, anInt2886, anInt3038, anInt5205, anInt2222, local18, local21, local27, true);
} else {
var24 = true;
method2762(local8.shapedTile, anInt2886, anInt3038, anInt5205, anInt2222, local18, local21, false);
method2762(local8.shapedTile, anInt2886, anInt3038, anInt5205, anInt2222, local18, local21, local27, false);
}
}
} else if (method187(local27, local18, local21)) {
@ -3915,6 +3916,9 @@ public class SceneGraph {
MiniMenu.anInt1742 = arg6;
MiniMenu.anInt2954 = arg7;
}
if (API.IsRoofVisibilityPicking() && method583(API.GetRoofVisibilityPickScreenX() + Rasteriser.centerX, API.GetRoofVisibilityPickScreenY() + Rasteriser.centerY, local315, local331, local299, local307, local323, local291)) {
API.ReportRoofVisibilityTile(arg6, arg7, arg1);
}
if (!GlRenderer.enabled && !arg8) {
Rasteriser.testX = local307 < 0 || local323 < 0 || local291 < 0 || local307 > Rasteriser.width || local323 > Rasteriser.width || local291 > Rasteriser.width;
if (arg0.anInt4869 == -1) {
@ -3938,6 +3942,9 @@ public class SceneGraph {
MiniMenu.anInt1742 = arg6;
MiniMenu.anInt2954 = arg7;
}
if (API.IsRoofVisibilityPicking() && method583(API.GetRoofVisibilityPickScreenX() + Rasteriser.centerX, API.GetRoofVisibilityPickScreenY() + Rasteriser.centerY, local283, local299, local331, local275, local291, local323)) {
API.ReportRoofVisibilityTile(arg6, arg7, arg1);
}
if (GlRenderer.enabled || arg8) {
return;
}
@ -4225,7 +4232,7 @@ public class SceneGraph {
}
@OriginalMember(owner = "client!lh", name = "a", descriptor = "(Lclient!fg;IIIIIIZ)V")
public static void method2762(@OriginalArg(0) ShapedTile arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6, @OriginalArg(7) boolean arg7) {
public static void method2762(@OriginalArg(0) ShapedTile arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6, int arg7, @OriginalArg(7) boolean arg8) {
@Pc(3) int local3 = arg0.anIntArray168.length;
@Pc(5) int local5;
@Pc(15) int local15;
@ -4268,7 +4275,10 @@ public class SceneGraph {
MiniMenu.anInt1742 = arg5;
MiniMenu.anInt2954 = arg6;
}
if (!GlRenderer.enabled && !arg7) {
if (API.IsRoofVisibilityPicking() && method583(API.GetRoofVisibilityPickScreenX() + Rasteriser.centerX, API.GetRoofVisibilityPickScreenY() + Rasteriser.centerY, local156, local160, local164, local39, local148, local152)) {
API.ReportRoofVisibilityTile(arg5, arg6, arg7);
}
if (!GlRenderer.enabled && !arg8) {
Rasteriser.testX = local39 < 0 || local148 < 0 || local152 < 0 || local39 > Rasteriser.width || local148 > Rasteriser.width || local152 > Rasteriser.width;
if (arg0.anIntArray161 == null || arg0.anIntArray161[local5] == -1) {
if (arg0.anIntArray167[local5] != 12345678) {

View file

@ -4,6 +4,7 @@ import org.openrs2.deob.annotation.OriginalArg;
import org.openrs2.deob.annotation.OriginalMember;
import org.openrs2.deob.annotation.Pc;
import plugin.PluginRepository;
import plugin.api.API;
import java.nio.charset.StandardCharsets;
import java.util.Calendar;
@ -116,15 +117,15 @@ public final class ScriptRunner {
@OriginalMember(owner = "client!vg", name = "c", descriptor = "Z")
public static boolean aBoolean299 = false;
@OriginalMember(owner = "client!lj", name = "z", descriptor = "[I")
public static int[] anIntArray338 = new int[2];
public static int[] anIntArray338 = new int[8];
@OriginalMember(owner = "client!vl", name = "i", descriptor = "[I")
public static int[] anIntArray518 = new int[2];
public static int[] anIntArray518 = new int[8];
@OriginalMember(owner = "client!tk", name = "K", descriptor = "[I")
public static int[] anIntArray476 = new int[2];
public static int[] anIntArray476 = new int[8];
@OriginalMember(owner = "client!e", name = "xc", descriptor = "[I")
public static int[] anIntArray134 = new int[2];
public static int[] anIntArray134 = new int[8];
@OriginalMember(owner = "client!ge", name = "k", descriptor = "[I")
public static int[] anIntArray205 = new int[2];
public static int[] anIntArray205 = new int[8];
@OriginalMember(owner = "client!nm", name = "W", descriptor = "Lclient!na;")
public static JagString url;
@OriginalMember(owner = "client!bf", name = "B", descriptor = "I")
@ -976,12 +977,16 @@ public final class ScriptRunner {
method2608();
} else {
method960((byte) (anInt3325 - 4 & 0xFF));
method3993(2);
method3993(API.GetRoofVisibilityGroupLimit());
}
}
@OriginalMember(owner = "client!tc", name = "a", descriptor = "(B)I")
public static int method4047() {
return getBaseRoofMode();
}
private static int getBaseRoofMode() {
if (neverRemoveRoofs) {
return 0;
} else if (SceneGraph.allLevelsAreVisible()) {
@ -991,6 +996,11 @@ public final class ScriptRunner {
}
}
public static boolean canUseSelectiveRoofHiding() {
return getBaseRoofMode() == 2;
}
@OriginalMember(owner = "client!ok", name = "a", descriptor = "(IIB)Lclient!ce;")
public static SecondaryLinkedList method3333(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1) {
@Pc(9) SecondaryLinkedList local9 = new SecondaryLinkedList();
@ -1042,18 +1052,31 @@ public final class ScriptRunner {
@OriginalMember(owner = "client!uj", name = "a", descriptor = "(BZII[[[Lclient!bj;I)Z")
public static boolean method4348(@OriginalArg(1) boolean arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) Tile[][][] arg3, @OriginalArg(5) int arg4) {
@Pc(14) byte local14 = arg0 ? 1 : (byte) (anInt3325 & 0xFF);
if (local14 == aByteArrayArrayArray15[Player.plane][arg1][arg2]) {
return method4348(arg0, arg1, arg2, arg3, arg4, Player.plane);
}
public static boolean hideRoofAt(int sceneX, int sceneZ, int group, int plane) {
return method4348(false, sceneX, sceneZ, SceneGraph.tiles, group, plane);
}
private static boolean method4348(boolean arg0, int arg1, int arg2, Tile[][][] arg3, int arg4, int plane) {
if (plane < 0 || plane >= 3) {
return false;
} else if ((SceneGraph.renderFlags[Player.plane][arg1][arg2] & 0x4) == 0) {
}
@Pc(14) byte local14 = arg0 ? 1 : (byte) (anInt3325 & 0xFF);
if (local14 == aByteArrayArrayArray15[plane][arg1][arg2]) {
return false;
} else if ((SceneGraph.renderFlags[plane][arg1][arg2] & API.TILE_FLAG_UNDER_ROOF) == 0) {
return false;
} else {
API.BeginRoofVisibilityGroup(arg4);
@Pc(47) int local47 = 0;
@Pc(49) byte local49 = 0;
PathFinder.queueX[0] = arg1;
@Pc(69) int local69 = local49 + 1;
PathFinder.queueZ[0] = arg2;
aByteArrayArrayArray15[Player.plane][arg1][arg2] = local14;
aByteArrayArrayArray15[plane][arg1][arg2] = local14;
while (local47 != local69) {
@Pc(94) int local94 = PathFinder.queueX[local47] >> 16 & 0xFF;
@Pc(102) int local102 = PathFinder.queueX[local47] >> 24 & 0xFF;
@ -1063,13 +1086,13 @@ public final class ScriptRunner {
local47 = local47 + 1 & 0xFFF;
@Pc(130) boolean local130 = false;
@Pc(132) boolean local132 = false;
if ((SceneGraph.renderFlags[Player.plane][local108][local122] & 0x4) == 0) {
if ((SceneGraph.renderFlags[plane][local108][local122] & API.TILE_FLAG_UNDER_ROOF) == 0) {
local130 = true;
}
@Pc(150) int local150;
@Pc(191) int local191;
label238:
for (local150 = Player.plane + 1; local150 <= 3; local150++) {
for (local150 = plane + 1; local150 <= 3; local150++) {
if ((SceneGraph.renderFlags[local150][local108][local122] & 0x8) == 0) {
@Pc(227) int local227;
@Pc(358) int local358;
@ -1124,8 +1147,8 @@ public final class ScriptRunner {
}
}
if (local132) {
if (SceneGraph.tileHeights[Player.plane + 1][local108][local122] > anIntArray205[arg4]) {
anIntArray205[arg4] = SceneGraph.tileHeights[Player.plane + 1][local108][local122];
if (SceneGraph.tileHeights[plane + 1][local108][local122] > anIntArray205[arg4]) {
anIntArray205[arg4] = SceneGraph.tileHeights[plane + 1][local108][local122];
}
local150 = local108 << 7;
if (local150 < anIntArray338[arg4]) {
@ -1139,60 +1162,61 @@ public final class ScriptRunner {
} else if (anIntArray134[arg4] < local191) {
anIntArray134[arg4] = local191;
}
API.AddRoofVisibilityGroupTile(arg4, plane, local108, local122);
}
if (!local130) {
if (local108 >= 1 && aByteArrayArrayArray15[Player.plane][local108 - 1][local122] != local14) {
if (local108 >= 1 && aByteArrayArrayArray15[plane][local108 - 1][local122] != local14) {
PathFinder.queueX[local69] = local108 - 1 | 0x120000 | 0xD3000000;
PathFinder.queueZ[local69] = local122 | 0x130000;
local69 = local69 + 1 & 0xFFF;
aByteArrayArrayArray15[Player.plane][local108 - 1][local122] = local14;
aByteArrayArrayArray15[plane][local108 - 1][local122] = local14;
}
local122++;
if (local122 < 104) {
if (local108 - 1 >= 0 && local14 != aByteArrayArrayArray15[Player.plane][local108 - 1][local122] && (SceneGraph.renderFlags[Player.plane][local108][local122] & 0x4) == 0 && (SceneGraph.renderFlags[Player.plane][local108 - 1][local122 - 1] & 0x4) == 0) {
if (local108 - 1 >= 0 && local14 != aByteArrayArrayArray15[plane][local108 - 1][local122] && (SceneGraph.renderFlags[plane][local108][local122] & API.TILE_FLAG_UNDER_ROOF) == 0 && (SceneGraph.renderFlags[plane][local108 - 1][local122 - 1] & API.TILE_FLAG_UNDER_ROOF) == 0) {
PathFinder.queueX[local69] = 0x52000000 | 0x120000 | local108 - 1;
PathFinder.queueZ[local69] = local122 | 0x130000;
aByteArrayArrayArray15[Player.plane][local108 - 1][local122] = local14;
aByteArrayArrayArray15[plane][local108 - 1][local122] = local14;
local69 = local69 + 1 & 0xFFF;
}
if (local14 != aByteArrayArrayArray15[Player.plane][local108][local122]) {
if (local14 != aByteArrayArrayArray15[plane][local108][local122]) {
PathFinder.queueX[local69] = local108 | 0x13000000 | 0x520000;
PathFinder.queueZ[local69] = local122 | 0x530000;
local69 = local69 + 1 & 0xFFF;
aByteArrayArrayArray15[Player.plane][local108][local122] = local14;
aByteArrayArrayArray15[plane][local108][local122] = local14;
}
if (local108 + 1 < 104 && aByteArrayArrayArray15[Player.plane][local108 + 1][local122] != local14 && (SceneGraph.renderFlags[Player.plane][local108][local122] & 0x4) == 0 && (SceneGraph.renderFlags[Player.plane][local108 + 1][local122 - 1] & 0x4) == 0) {
if (local108 + 1 < 104 && aByteArrayArrayArray15[plane][local108 + 1][local122] != local14 && (SceneGraph.renderFlags[plane][local108][local122] & API.TILE_FLAG_UNDER_ROOF) == 0 && (SceneGraph.renderFlags[plane][local108 + 1][local122 - 1] & API.TILE_FLAG_UNDER_ROOF) == 0) {
PathFinder.queueX[local69] = 0x92000000 | 0x520000 | local108 + 1;
PathFinder.queueZ[local69] = local122 | 0x530000;
aByteArrayArrayArray15[Player.plane][local108 + 1][local122] = local14;
aByteArrayArrayArray15[plane][local108 + 1][local122] = local14;
local69 = local69 + 1 & 0xFFF;
}
}
local122--;
if (local108 + 1 < 104 && local14 != aByteArrayArrayArray15[Player.plane][local108 + 1][local122]) {
if (local108 + 1 < 104 && local14 != aByteArrayArrayArray15[plane][local108 + 1][local122]) {
PathFinder.queueX[local69] = local108 + 1 | 0x920000 | 0x53000000;
PathFinder.queueZ[local69] = local122 | 0x930000;
aByteArrayArrayArray15[Player.plane][local108 + 1][local122] = local14;
aByteArrayArrayArray15[plane][local108 + 1][local122] = local14;
local69 = local69 + 1 & 0xFFF;
}
local122--;
if (local122 >= 0) {
if (local108 - 1 >= 0 && aByteArrayArrayArray15[Player.plane][local108 - 1][local122] != local14 && (SceneGraph.renderFlags[Player.plane][local108][local122] & 0x4) == 0 && (SceneGraph.renderFlags[Player.plane][local108 - 1][local122 + 1] & 0x4) == 0) {
if (local108 - 1 >= 0 && aByteArrayArrayArray15[plane][local108 - 1][local122] != local14 && (SceneGraph.renderFlags[plane][local108][local122] & API.TILE_FLAG_UNDER_ROOF) == 0 && (SceneGraph.renderFlags[plane][local108 - 1][local122 + 1] & API.TILE_FLAG_UNDER_ROOF) == 0) {
PathFinder.queueX[local69] = local108 - 1 | 0xD20000 | 0x12000000;
PathFinder.queueZ[local69] = local122 | 0xD30000;
aByteArrayArrayArray15[Player.plane][local108 - 1][local122] = local14;
aByteArrayArrayArray15[plane][local108 - 1][local122] = local14;
local69 = local69 + 1 & 0xFFF;
}
if (local14 != aByteArrayArrayArray15[Player.plane][local108][local122]) {
if (local14 != aByteArrayArrayArray15[plane][local108][local122]) {
PathFinder.queueX[local69] = local108 | 0xD20000 | 0x93000000;
PathFinder.queueZ[local69] = local122 | 0xD30000;
local69 = local69 + 1 & 0xFFF;
aByteArrayArrayArray15[Player.plane][local108][local122] = local14;
aByteArrayArrayArray15[plane][local108][local122] = local14;
}
if (local108 + 1 < 104 && aByteArrayArrayArray15[Player.plane][local108 + 1][local122] != local14 && (SceneGraph.renderFlags[Player.plane][local108][local122] & 0x4) == 0 && (SceneGraph.renderFlags[Player.plane][local108 + 1][local122 + 1] & 0x4) == 0) {
if (local108 + 1 < 104 && aByteArrayArrayArray15[plane][local108 + 1][local122] != local14 && (SceneGraph.renderFlags[plane][local108][local122] & API.TILE_FLAG_UNDER_ROOF) == 0 && (SceneGraph.renderFlags[plane][local108 + 1][local122 + 1] & API.TILE_FLAG_UNDER_ROOF) == 0) {
PathFinder.queueX[local69] = local108 + 1 | 0xD2000000 | 0x920000;
PathFinder.queueZ[local69] = local122 | 0x930000;
aByteArrayArrayArray15[Player.plane][local108 + 1][local122] = local14;
aByteArrayArrayArray15[plane][local108 + 1][local122] = local14;
local69 = local69 + 1 & 0xFFF;
}
}
@ -1316,9 +1340,12 @@ public final class ScriptRunner {
@OriginalMember(owner = "client!uh", name = "f", descriptor = "(I)V")
public static void method4302() {
API.DisableRoofVisibilityIfExpired();
if (method4047() != 2) {
return;
}
API.EnsureRoofVisibilityBuffers();
boolean roofVisibilityActive = API.IsRoofVisibilityActive();
@Pc(27) byte local27 = (byte) (anInt3325 - 4 & 0xFF);
@Pc(31) int local31 = anInt3325 % 104;
@Pc(33) int local33;
@ -1331,7 +1358,7 @@ public final class ScriptRunner {
if (Player.plane == 3) {
return;
}
for (local33 = 0; local33 < 2; local33++) {
for (local33 = 0; local33 < anIntArray205.length; local33++) {
anIntArray205[local33] = -1000000;
anIntArray338[local33] = 1000000;
anIntArray518[local33] = 0;
@ -1340,14 +1367,17 @@ public final class ScriptRunner {
}
if (Camera.cameraType != 1) {
local33 = SceneGraph.getTileHeight(Player.plane, Camera.renderX, Camera.renderZ);
if (local33 - Camera.anInt40 < 800 && (SceneGraph.renderFlags[Player.plane][Camera.renderX >> 7][Camera.renderZ >> 7] & 0x4) != 0) {
if (local33 - Camera.anInt40 < 800 && (SceneGraph.renderFlags[Player.plane][Camera.renderX >> 7][Camera.renderZ >> 7] & API.TILE_FLAG_UNDER_ROOF) != 0) {
method4348(false, Camera.renderX >> 7, Camera.renderZ >> 7, SceneGraph.tiles, 1);
}
return;
}
if ((SceneGraph.renderFlags[Player.plane][PlayerList.self.xFine >> 7][PlayerList.self.zFine >> 7] & 0x4) != 0) {
if ((SceneGraph.renderFlags[Player.plane][PlayerList.self.xFine >> 7][PlayerList.self.zFine >> 7] & API.TILE_FLAG_UNDER_ROOF) != 0) {
method4348(false, PlayerList.self.xFine >> 7, PlayerList.self.zFine >> 7, SceneGraph.tiles, 0);
}
if (roofVisibilityActive) {
API.ApplyRoofVisibilityRequests();
}
if (Camera.cameraPitch >= 310) {
return;
}
@ -1378,7 +1408,7 @@ public final class ScriptRunner {
} else if (local40 > local135) {
local40--;
}
if ((SceneGraph.renderFlags[Player.plane][local33][local40] & 0x4) != 0) {
if ((SceneGraph.renderFlags[Player.plane][local33][local40] & API.TILE_FLAG_UNDER_ROOF) != 0) {
method4348(false, local33, local40, SceneGraph.tiles, 1);
break;
}
@ -1390,7 +1420,7 @@ public final class ScriptRunner {
local33--;
}
local186 -= 65536;
if ((SceneGraph.renderFlags[Player.plane][local33][local40] & 0x4) != 0) {
if ((SceneGraph.renderFlags[Player.plane][local33][local40] & API.TILE_FLAG_UNDER_ROOF) != 0) {
method4348(false, local33, local40, SceneGraph.tiles, 1);
break;
}
@ -1406,7 +1436,7 @@ public final class ScriptRunner {
} else if (local33 > local162) {
local33--;
}
if ((SceneGraph.renderFlags[Player.plane][local33][local40] & 0x4) != 0) {
if ((SceneGraph.renderFlags[Player.plane][local33][local40] & API.TILE_FLAG_UNDER_ROOF) != 0) {
method4348(false, local33, local40, SceneGraph.tiles, 1);
break;
}
@ -1418,7 +1448,7 @@ public final class ScriptRunner {
local40--;
}
local186 -= 65536;
if ((SceneGraph.renderFlags[Player.plane][local33][local40] & 0x4) != 0) {
if ((SceneGraph.renderFlags[Player.plane][local33][local40] & API.TILE_FLAG_UNDER_ROOF) != 0) {
method4348(false, local33, local40, SceneGraph.tiles, 1);
break;
}

View file

@ -4,6 +4,7 @@ import org.openrs2.deob.annotation.OriginalArg;
import org.openrs2.deob.annotation.OriginalClass;
import org.openrs2.deob.annotation.OriginalMember;
import org.openrs2.deob.annotation.Pc;
import plugin.api.API;
@OriginalClass("client!w")
public final class SoftwareModel extends Model {
@ -833,7 +834,9 @@ public final class SoftwareModel extends Model {
@Pc(223) int x;
@Pc(208) int y;
@Pc(227) int z;
if (key > 0L && RawModel.allowInput && d > 0) {
@Pc(229) boolean roofVisibilityLocPick = API.IsRoofVisibilityLocPickable(key);
@Pc(232) boolean miniMenuPick = key > 0L;
if ((miniMenuPick || roofVisibilityLocPick) && RawModel.allowInput && d > 0) {
if (e > 0) {
v = maxScreenX / c;
y = minScreenX / d;
@ -893,7 +896,12 @@ public final class SoftwareModel extends Model {
}
if (GlModel.anInt3582 >= v && GlModel.anInt3582 <= y && RawModel.anInt1053 >= x && RawModel.anInt1053 <= z) {
if (this.pickable) {
Model.aLongArray11[MiniMenu.anInt7++] = key;
if (miniMenuPick) {
Model.aLongArray11[MiniMenu.anInt7++] = key;
}
if (roofVisibilityLocPick) {
API.ReportRoofVisibilityLoc(key, arg9);
}
} else {
local190 = true;
}
@ -933,7 +941,7 @@ public final class SoftwareModel extends Model {
}
}
try {
this.draw(project1, local190, key, b - d, c - d + 2, arg10);
this.draw(project1, local190, key, b - d, c - d + 2, arg9, arg10);
} catch (@Pc(713) Exception ex) {
ex.printStackTrace();
}
@ -1148,7 +1156,7 @@ public final class SoftwareModel extends Model {
projectSceneZ[local52] = local71;
}
}
this.draw(false, arg6 >= 0L, arg6, this.aShort35, this.aShort35 << 1, null);
this.draw(false, arg6 >= 0L || API.IsRoofVisibilityLocPickable(arg6), arg6, this.aShort35, this.aShort35 << 1, Player.plane, null);
} catch (@Pc(240) RuntimeException local240) {
}
}
@ -1583,7 +1591,7 @@ public final class SoftwareModel extends Model {
}
@OriginalMember(owner = "client!w", name = "a", descriptor = "(ZZJIILclient!ga;)V")
private void draw(@OriginalArg(0) boolean arg0, @OriginalArg(1) boolean arg1, @OriginalArg(2) long arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) ParticleSystem arg5) {
private void draw(@OriginalArg(0) boolean arg0, @OriginalArg(1) boolean arg1, @OriginalArg(2) long arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, int roofHidePlane, @OriginalArg(5) ParticleSystem arg5) {
if (arg4 >= 1600) {
return;
}
@ -1659,7 +1667,12 @@ public final class SoftwareModel extends Model {
}
} else {
if (arg1 && this.pointWithinTriangle(GlModel.anInt3582 + Rasteriser.centerX, RawModel.anInt1053 + Rasteriser.centerY, vertexScreenY[local51], vertexScreenY[local56], vertexScreenY[pri], local65, local69, local73)) {
Model.aLongArray11[MiniMenu.anInt7++] = arg2;
if (arg2 >= 0L) {
Model.aLongArray11[MiniMenu.anInt7++] = arg2;
}
if (API.IsRoofVisibilityLocPickable(arg2)) {
API.ReportRoofVisibilityLoc(arg2, roofHidePlane);
}
arg1 = false;
}
if ((local65 - local69) * (vertexScreenY[pri] - vertexScreenY[local56]) - (vertexScreenY[local51] - vertexScreenY[local56]) * (local73 - local69) > 0) {
@ -1946,7 +1959,7 @@ public final class SoftwareModel extends Model {
projectSceneZ[local52] = local71;
}
}
this.draw(false, false, 0L, this.aShort35, this.aShort35 << 1, null);
this.draw(false, false, 0L, this.aShort35, this.aShort35 << 1, Player.plane, null);
} catch (@Pc(234) RuntimeException local234) {
}
}