Skip to content

Commit

Permalink
Merge #850 (Fullbright/X-Ray gamma fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Dec 14, 2023
2 parents 125ebcd + 04c51e2 commit b404933
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/main/java/net/wurstclient/hacks/FullbrightHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ public void onUpdate()

private void updateGamma()
{
boolean shouldChangeGamma =
isEnabled() && method.getSelected() == Method.GAMMA;

if(shouldChangeGamma)
if(isChangingGamma())
{
setGamma(16);
return;
Expand Down Expand Up @@ -163,6 +160,11 @@ public float getNightVisionStrength()
return nightVisionStrength;
}

public boolean isChangingGamma()
{
return isEnabled() && method.getSelected() == Method.GAMMA;
}

/**
* Returns the value of Fullbright's "Default brightness" slider. Used by
* {@link XRayHack} to restore the gamma value when X-Ray is turned off.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/wurstclient/hacks/XRayHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public void onDisable()

// reset gamma
FullbrightHack fullbright = WURST.getHax().fullbrightHack;
if(!fullbright.isEnabled())
if(!fullbright.isChangingGamma())
ISimpleOption.get(MC.options.getGamma())
.forceSetValue(fullbright.getDefaultGamma());
}
Expand Down

0 comments on commit b404933

Please sign in to comment.