fix selection issue

This commit is contained in:
aPunch 2012-03-02 04:19:18 -06:00
parent c57ca76b4f
commit 1e8237a097
2 changed files with 2 additions and 1 deletions

Binary file not shown.

View File

@ -137,7 +137,8 @@ public class EventListen implements Listener {
NPC npc = npcManager.getNPC(event.getEntity());
Player player = (Player) event.getTarget();
if (player.getMetadata("selected").size() == 0 || player.getMetadata("selected").get(0).asInt() != npc.getId()) {
if (!player.hasMetadata("selected") || player.getMetadata("selected").size() == 0
|| player.getMetadata("selected").get(0).asInt() != npc.getId()) {
if (player.getItemInHand().getTypeId() == Setting.SELECTION_ITEM.asInt()
&& (npc.getTrait(Owner.class).getOwner().equals(player.getName()) || player
.hasPermission("citizens.admin"))) {