From 2c898a819201d7f3be25c10a834b7605d494b68f Mon Sep 17 00:00:00 2001 From: johni0702 Date: Sat, 24 Dec 2016 01:44:51 +0100 Subject: [PATCH] Prevent rendering without sufficient keyframes (fixes #45) --- .../java/com/replaymod/simplepathing/gui/GuiPathing.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/replaymod/simplepathing/gui/GuiPathing.java b/src/main/java/com/replaymod/simplepathing/gui/GuiPathing.java index 91815070..2c21a106 100644 --- a/src/main/java/com/replaymod/simplepathing/gui/GuiPathing.java +++ b/src/main/java/com/replaymod/simplepathing/gui/GuiPathing.java @@ -512,6 +512,13 @@ public class GuiPathing { lastTime = time; } + // Make sure there are at least two position- and two time-keyframes + if (timeline.getPaths().get(POSITION_PATH).getSegments().isEmpty() + || timeline.getPaths().get(TIME_PATH).getSegments().isEmpty()) { + GuiInfoPopup.open(replayHandler.getOverlay(), "replaymod.chat.morekeyframes"); + return false; + } + return true; }