Fixed crash when closing the worldmap sometimes

This commit is contained in:
Pazaz 2022-05-05 12:11:40 -04:00
parent 8dc27ef51e
commit 77bfb744bc
23 changed files with 111 additions and 108 deletions

View file

@ -66,10 +66,10 @@ public final class Static156 {
@Pc(152) int local152 = Static193.anInt4539 + local113 - Static277.tileVisibilityDistance;
if (local146 >= 0 && local152 >= 0 && local146 < SceneGraph.mapSizeX && local152 < SceneGraph.mapSizeZ) {
@Pc(176) int local176;
if (Static80.underWaterTileHeightMap == null) {
if (SceneGraph.underwaterTileHeights == null) {
local176 = SceneGraph.surfaceTileHeights[0][local146][local152] + 128 - Static123.anInt3947;
} else {
local176 = Static80.underWaterTileHeightMap[0][local146][local152] + 128 - Static123.anInt3947;
local176 = SceneGraph.underwaterTileHeights[0][local146][local152] + 128 - Static123.anInt3947;
}
@Pc(201) int local201 = SceneGraph.surfaceTileHeights[3][local146][local152] - Static123.anInt3947 - 1000;
Static89.aBooleanArrayArray3[local104][local113] = Static160.method3049(local130, local201, local176, local140, local99);
@ -103,30 +103,6 @@ public final class Static156 {
Static248.method3292(arg0, arg1, arg2, arg5, arg11, arg12, arg13, arg14);
}
@OriginalMember(owner = "client!mf", name = "a", descriptor = "()V")
public static void method2959() {
@Pc(1) GL2 local1 = GlRenderer.gl;
local1.glDisableClientState(GL2.GL_COLOR_ARRAY);
GlRenderer.setLightingEnabled(false);
local1.glDisable(GL2.GL_DEPTH_TEST);
local1.glPushAttrib(GL2.GL_FOG_BIT);
local1.glFogf(GL2.GL_FOG_START, (float) GlobalConfig.VIEW_DISTANCE - (GlobalConfig.VIEW_FADE_DISTANCE * 2.0f));
GlRenderer.disableDepthMask();
for (@Pc(19) int local19 = 0; local19 < SceneGraph.surfaceHdTiles[0].length; local19++) {
@Pc(31) GlTile local31 = SceneGraph.surfaceHdTiles[0][local19];
if (local31.anInt2485 >= 0 && Rasteriser.textureProvider.method3237(local31.anInt2485) == 4) {
local1.glColor4fv(Static190.method3441(local31.anInt2486), 0);
@Pc(57) float local57 = 201.5F - (local31.aBoolean140 ? 1.0F : 0.5F);
local31.method1944(SceneGraph.tiles, local57, true);
}
}
local1.glEnableClientState(GL2.GL_COLOR_ARRAY);
GlRenderer.method4173();
local1.glEnable(GL2.GL_DEPTH_TEST);
local1.glPopAttrib();
GlRenderer.enableDepthMask();
}
@OriginalMember(owner = "client!mf", name = "a", descriptor = "(BLclient!wa;)Lclient!ta;")
public static TextureOp29SubOp4 method2960(@OriginalArg(1) Buffer arg0) {
return new TextureOp29SubOp4(arg0.g2s(), arg0.g2s(), arg0.g2s(), arg0.g2s(), arg0.g3(), arg0.g3(), arg0.g1());