Fixed probable NPE when admin uses not owned items.
Contributed by nasseka.
This commit is contained in:
parent
0dd4940967
commit
6eb6b14ebd
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -105,7 +105,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -105,7 +105,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -105,7 +105,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -105,7 +105,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -105,7 +105,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -108,7 +108,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public class RequestDestroyItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
if (_count > ((Item) obj).getCount())
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ public class UseItem implements IClientIncomingPacket
|
||||
if (player.isGM())
|
||||
{
|
||||
final WorldObject obj = World.getInstance().findObject(_objectId);
|
||||
if (obj.isItem())
|
||||
if ((obj != null) && obj.isItem())
|
||||
{
|
||||
AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user