Skip to content

Commit

Permalink
NPC Despawn event can fire after remove
Browse files Browse the repository at this point in the history
For some stupid reason.
  • Loading branch information
mcmonkey4eva committed Oct 19, 2014
1 parent 74a5a86 commit daccaa4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/net/aufdemrand/denizen/npc/dNPCRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,11 @@ public void despawn(NPCDespawnEvent event) {
dNPC npc = getDenizen(event.getNPC());

// Do world script event 'On NPC Despawns'
EventManager.doEvents(Arrays.asList("npc despawns"), npc, null, null);
if (npc != null)
EventManager.doEvents(Arrays.asList("npc despawns"), npc, null, null);

npc.action("despawn", null);
if (npc != null)
npc.action("despawn", null);
}


Expand Down

0 comments on commit daccaa4

Please sign in to comment.