From 36f9f25116188a2996b20016add62a1d463070e3 Mon Sep 17 00:00:00 2001 From: YukonAppleGeek Date: Fri, 20 Dec 2013 00:09:33 -0600 Subject: [PATCH] Always remove disguise and update if necessary --- .../disguise/disguisetypes/Disguise.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/Disguise.java b/src/me/libraryaddict/disguise/disguisetypes/Disguise.java index ecc019e2..b24baead 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/src/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -379,14 +379,15 @@ public abstract class Disguise { HashMap> disguises = DisguiseUtilities.getDisguises(); // If this disguise has a entity set if (getEntity() != null) { - // If the entity is valid - if (getEntity().isValid()) { - // If this disguise is active - // Remove the disguise from the current disguises. - if (DisguiseUtilities.removeDisguise((TargetedDisguise) this)) { - if (getEntity() instanceof Player) { - DisguiseUtilities.removeSelfDisguise((Player) getEntity()); - } + // If this disguise is active + // Remove the disguise from the current disguises. + if (DisguiseUtilities.removeDisguise((TargetedDisguise) this)) { + if (getEntity() instanceof Player) { + DisguiseUtilities.removeSelfDisguise((Player) getEntity()); + } + + // If the entity is not dead + if (getEntity().isValid()) { // Better refresh the entity to undisguise it DisguiseUtilities.refreshTrackers((TargetedDisguise) this); }