From 73b962cb2067eb701a6b517342b57049aa68dac8 Mon Sep 17 00:00:00 2001 From: fullwall Date: Fri, 4 Jan 2013 16:20:13 +0800 Subject: [PATCH] Fix entity controller not removing properly on spawn fail --- src/main/java/net/citizensnpcs/npc/CitizensNPC.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/citizensnpcs/npc/CitizensNPC.java b/src/main/java/net/citizensnpcs/npc/CitizensNPC.java index d52d94a71..2cf3ba5b3 100644 --- a/src/main/java/net/citizensnpcs/npc/CitizensNPC.java +++ b/src/main/java/net/citizensnpcs/npc/CitizensNPC.java @@ -204,7 +204,7 @@ public class CitizensNPC extends AbstractNPC { if (!couldSpawn) { Messaging.debug("Retrying spawn of", getId(), "later due to chunk being unloaded."); // we need to wait for a chunk load before trying to spawn - mcEntity = null; + entityController.remove(); EventListen.addForRespawn(at, getId()); return true; } @@ -212,7 +212,7 @@ public class CitizensNPC extends AbstractNPC { NPCSpawnEvent spawnEvent = new NPCSpawnEvent(this, at); Bukkit.getPluginManager().callEvent(spawnEvent); if (spawnEvent.isCancelled()) { - mcEntity = null; + entityController.remove(); Messaging.debug("Couldn't spawn", getId(), "due to event cancellation."); return false; }