From d133072305b43eb29b19db74c8e5317ecbc501b4 Mon Sep 17 00:00:00 2001 From: CrushedPixel Date: Sat, 23 May 2015 14:28:03 +0200 Subject: [PATCH] Fixed NPE when using wrong instance check (It was late, don't blame me) --- .../eu/crushedpixel/replaymod/events/GuiReplayOverlay.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/crushedpixel/replaymod/events/GuiReplayOverlay.java b/src/main/java/eu/crushedpixel/replaymod/events/GuiReplayOverlay.java index 51739747..113cacab 100755 --- a/src/main/java/eu/crushedpixel/replaymod/events/GuiReplayOverlay.java +++ b/src/main/java/eu/crushedpixel/replaymod/events/GuiReplayOverlay.java @@ -309,7 +309,7 @@ public class GuiReplayOverlay extends Gui { GlStateManager.resetColor(); this.drawModalRectWithCustomSizedTexture(time_ButtonX, time_ButtonY, x, y, 20, 20, 64, 64); - if(mouseX >= (timelineX + 4) && mouseX <= width - 18 && mouseY >= 11 && mouseY <= 29 && mc.currentScreen.getClass() == GuiMouseInput.class) { + if(mouseX >= (timelineX + 4) && mouseX <= width - 18 && mouseY >= 11 && mouseY <= 29 && FMLClientHandler.instance().isGUIOpen(GuiMouseInput.class)) { double tot = (width - 18) - (timelineX + 4); double perc = (mouseX - (timelineX + 4)) / tot; long time = Math.round(perc * (double) ReplayMod.replaySender.replayLength()); @@ -476,7 +476,7 @@ public class GuiReplayOverlay extends Gui { } //show Time String - if(mouseX >= zero && mouseX <= full && mouseY >= y && mouseY <= y + 22 && mc.currentScreen.getClass() == GuiMouseInput.class) { + if(mouseX >= zero && mouseX <= full && mouseY >= y && mouseY <= y + 22 && FMLClientHandler.instance().isGUIOpen(GuiMouseInput.class)) { long tot = Math.round((double) timelineLength * zoom_scale); double perc = (mouseX - (realTimelineX + 4)) / (double) (full - zero);