Skip to content

Commit

Permalink
Don't try to load NPCs when handling flags
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 31, 2015
1 parent 122f886 commit 9927944
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/main/java/net/aufdemrand/denizen/flags/FlagManager.java
Expand Up @@ -7,6 +7,7 @@
import net.aufdemrand.denizen.objects.dNPC;
import net.aufdemrand.denizen.objects.dPlayer;
import net.aufdemrand.denizen.utilities.DenizenAPI;
import net.aufdemrand.denizen.utilities.depends.Depends;
import net.aufdemrand.denizencore.events.OldEventManager;
import net.aufdemrand.denizencore.objects.*;
import org.bukkit.configuration.ConfigurationSection;
Expand Down Expand Up @@ -357,7 +358,7 @@ public void clear() {
if (dPlayer.matches(OldOwner))
player = dPlayer.valueOf(OldOwner);
dNPC npc = null;
if (dNPC.matches(OldOwner))
if (Depends.citizens != null && dNPC.matches(OldOwner))
npc = dNPC.valueOf(OldOwner);

String type;
Expand Down Expand Up @@ -597,7 +598,7 @@ public void save() {
dPlayer player = null;
if (dPlayer.matches(OldOwner)) player = dPlayer.valueOf(OldOwner);
dNPC npc = null;
if (dNPC.matches(OldOwner)) npc = dNPC.valueOf(OldOwner);
if (Depends.citizens != null && dNPC.matches(OldOwner)) npc = dNPC.valueOf(OldOwner);
dEntity entity = null;
if (dEntity.matches(OldOwner)) entity = dEntity.valueOf(OldOwner);

Expand Down Expand Up @@ -694,7 +695,7 @@ public boolean checkExpired() {
if (dPlayer.matches(OldOwner))
player = dPlayer.valueOf(OldOwner);
dNPC npc = null;
if (dNPC.matches(OldOwner))
if (Depends.citizens != null && dNPC.matches(OldOwner))
npc = dNPC.valueOf(OldOwner);
dEntity entity = null;
if (dEntity.matches(OldOwner))
Expand Down
Expand Up @@ -36,7 +36,7 @@
public class ChatTrigger extends AbstractTrigger implements Listener {

final static Pattern triggerPattern = Pattern.compile("/([^/]*)/");
final static boolean HyperDebug = false;
final static boolean HyperDebug = false; // TODO: Replace with core->dB.verbose!

@Override
public void onEnable() {
Expand Down

0 comments on commit 9927944

Please sign in to comment.