Skip to content

Commit

Permalink
Use Citizens' NPC.teleport() function, fixes #492
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 28, 2013
1 parent 8f04be3 commit 57cc1fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/net/aufdemrand/denizen/objects/dEntity.java
Expand Up @@ -592,7 +592,8 @@ public World getWorld() {

public void spawnAt(Location location) {
// If the entity is already spawned, teleport it.
if (entity != null && isUnique()) entity.teleport(location);
if (npc != null) npc.teleport(location, TeleportCause.PLUGIN);
else if (entity != null && isUnique()) entity.teleport(location);

else {
if (npc != null) {
Expand Down

2 comments on commit 57cc1fc

@aufdemrand
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be getNPC. The NPC reference isn't always established.

@mcmonkey4eva
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kaykay. Will fix.

Please sign in to comment.