Skip to content

Commit 6a7b095

Browse files
committed
Waypoint Line Fix
1 parent c73e794 commit 6a7b095

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

src/main/java/net/wurstclient/hacks/WaypointsHack.java

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,24 @@ public void onRender(MatrixStack matrices, float partialTicks)
406406
boolean renderLabel = infiniteLabels || allowBySlider;
407407
boolean beyondMaxVisible =
408408
distSq > (double)(w.getMaxVisible() * w.getMaxVisible());
409-
if(beyondMaxVisible && !renderLabel)
409+
// Don't skip entirely if the waypoint has lines enabled - lines
410+
// should render regardless of label visibility/distance.
411+
if(beyondMaxVisible && !renderLabel && !w.isLines())
410412
continue;
413+
414+
// draw tracer + box if enabled. Lines should be rendered
415+
// regardless of beyondMaxVisible so users can always see
416+
// the tracer when the "lines" option is enabled.
417+
if(w.isLines())
418+
{
419+
RenderUtils.drawTracer(matrices, partialTicks,
420+
new Vec3d(wp.getX() + 0.5, wp.getY() + 0.5,
421+
wp.getZ() + 0.5),
422+
applyFade(w.getColor(), distSq), false);
423+
RenderUtils.drawOutlinedBoxes(matrices,
424+
java.util.List.of(new Box(wp)),
425+
applyFade(w.getColor(), distSq), false);
426+
}
411427

412428
if(!beyondMaxVisible)
413429
{
@@ -426,17 +442,6 @@ public void onRender(MatrixStack matrices, float partialTicks)
426442
}
427443
}
428444

429-
// draw tracer + box if enabled
430-
if(w.isLines())
431-
{
432-
RenderUtils.drawTracer(matrices, partialTicks,
433-
new Vec3d(wp.getX() + 0.5, wp.getY() + 0.5,
434-
wp.getZ() + 0.5),
435-
applyFade(w.getColor(), distSq), false);
436-
RenderUtils.drawOutlinedBoxes(matrices,
437-
java.util.List.of(new Box(wp)),
438-
applyFade(w.getColor(), distSq), false);
439-
}
440445
Waypoint.BeaconMode beaconMode = waypointBeaconMode(w);
441446
if(beaconsEnabled && beaconMode != Waypoint.BeaconMode.OFF)
442447
{

0 commit comments

Comments
 (0)