Skip to content

Commit

Permalink
Fix TextTabOverlay crash (Moulberry#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulonaut authored Sep 26, 2022
1 parent 1e71e3e commit 29bc337
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ public void tick() {
public void realTick() {
shouldUpdateOverlay = shouldUpdate();
if (shouldUpdateOverlay) {
boolean currentTabState =
Keyboard.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindPlayerList.getKeyCode());
int keycode = Minecraft.getMinecraft().gameSettings.keyBindPlayerList.getKeyCode();
boolean currentTabState;
if (keycode > 0) {
currentTabState = Keyboard.isKeyDown(keycode);
} else {
currentTabState = false;
}
if (lastTabState != currentTabState) {
lastTabState = currentTabState;
update();
Expand Down

0 comments on commit 29bc337

Please sign in to comment.