@@ -1362,11 +1362,12 @@ private void draw2DEntityElements() {
13621362 if (this .showDebug ) {
13631363 // true tile overlay
13641364 if (entity .pathLength > 0 || entity .forceMoveEndCycle >= loopCycle || entity .forceMoveStartCycle > loopCycle ) {
1365- this .drawTileOverlay (entity .pathTileX [0 ] * 128 + 64 , entity .pathTileZ [0 ] * 128 + 64 , this .currentLevel , 0x666666 , true );
1365+ int halfUnit = 64 * entity .size ;
1366+ this .drawTileOverlay (entity .pathTileX [0 ] * 128 + halfUnit , entity .pathTileZ [0 ] * 128 + halfUnit , this .currentLevel , entity .size , 0x666666 , true );
13661367 }
13671368
13681369 // local tile overlay
1369- this .drawTileOverlay (entity .x , entity .z , this .currentLevel , 0x444444 , false );
1370+ this .drawTileOverlay (entity .x , entity .z , this .currentLevel , entity . size , 0x444444 , false );
13701371
13711372 int offsetY = 0 ;
13721373 this .projectFromGround (entity , entity .height + 30 );
@@ -2875,8 +2876,8 @@ private void pushPlayers() {
28752876
28762877 @ OriginalMember (owner = "client!client" , name = "a" , descriptor = "(IIBI)I" )
28772878 private int getHeightmapY (@ OriginalArg (0 ) int level , @ OriginalArg (1 ) int sceneX , @ OriginalArg (3 ) int sceneZ ) {
2878- @ Pc (11 ) int tileX = sceneX >> 7 ;
2879- @ Pc (15 ) int tileZ = sceneZ >> 7 ;
2879+ @ Pc (11 ) int tileX = Math . min ( sceneX >> 7 , 103 ) ;
2880+ @ Pc (15 ) int tileZ = Math . min ( sceneZ >> 7 , 103 ) ;
28802881 @ Pc (17 ) int realLevel = level ;
28812882 if (level < 3 && (this .levelTileFlags [1 ][tileX ][tileZ ] & 0x2 ) == 2 ) {
28822883 realLevel = level + 1 ;
@@ -6895,24 +6896,24 @@ private void drawInfoOverlay() {
68956896 }
68966897 }
68976898
6898- private void drawTileOverlay (int x , int z , int level , int color , boolean crossed ) {
6899+ private void drawTileOverlay (int x , int z , int level , int size , int color , boolean crossed ) {
68996900 int height = this .getHeightmapY (level , x , z );
69006901 int x0 , y0 ;
69016902 int x1 , y1 ;
69026903 int x2 , y2 ;
69036904 int x3 , y3 ;
69046905
6905- // x/z should be the center of a tile which is 128 client-units large, so +/- 64 puts us at the edges
6906- this .project (x - 64 , height , z - 64 );
6906+ int halfUnit = 64 * size ;
6907+ this .project (x - halfUnit , height , z - halfUnit );
69076908 x0 = this .projectX ;
69086909 y0 = this .projectY ;
6909- this .project (x + 64 , height , z - 64 );
6910+ this .project (x + halfUnit , height , z - halfUnit );
69106911 x1 = this .projectX ;
69116912 y1 = this .projectY ;
6912- this .project (x - 64 , height , z + 64 );
6913+ this .project (x - halfUnit , height , z + halfUnit );
69136914 x2 = this .projectX ;
69146915 y2 = this .projectY ;
6915- this .project (x + 64 , height , z + 64 );
6916+ this .project (x + halfUnit , height , z + halfUnit );
69166917 x3 = this .projectX ;
69176918 y3 = this .projectY ;
69186919
0 commit comments