From 17094fdeca0cdda8ad8acb75bb2c79b266bf0814 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 1 Oct 2013 02:47:40 +1300 Subject: [PATCH] Fix potential infinite loop --- src/me/libraryaddict/disguise/DisguiseAPI.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/me/libraryaddict/disguise/DisguiseAPI.java b/src/me/libraryaddict/disguise/DisguiseAPI.java index 56cf9896..48616341 100644 --- a/src/me/libraryaddict/disguise/DisguiseAPI.java +++ b/src/me/libraryaddict/disguise/DisguiseAPI.java @@ -280,7 +280,7 @@ public class DisguiseAPI { */ private static void setupPlayerFakeDisguise(final Disguise disguise) { // If the disguises entity is null, or the disguised entity isn't a player return - if (disguise.getEntity() == null || !(disguise.getEntity() instanceof Player)) + if (disguise.getEntity() == null || !(disguise.getEntity() instanceof Player) || !disguises.containsValue(disguise)) return; Player player = (Player) disguise.getEntity(); // Remove the old disguise, else we have weird disguises around the place @@ -295,6 +295,7 @@ public class DisguiseAPI { if (tracker == null) { // A check incase the tracker is null. // If it is, then this method will be run again in one tick. Which is when it should be constructed. + // Else its going to run in a infinite loop hue hue hue.. Bukkit.getScheduler().scheduleSyncDelayedTask(libsDisguises, new Runnable() { public void run() { setupPlayerFakeDisguise(disguise);