Merge selection fix

This commit is contained in:
fullwall 2012-03-02 19:10:46 +08:00
parent bc946e0892
commit b019763675

View File

@ -101,7 +101,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"))) {