From 860130cff2d17fdef1ed2439f76abfc499d199bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Wed, 1 Oct 2014 18:36:14 +0200 Subject: [PATCH] Fixed check for whether used item has been 'used up' in robots for cases where the stack is replaced by the interact function. Fixes #583. --- .../scala/li/cil/oc/server/component/robot/Player.scala | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/scala/li/cil/oc/server/component/robot/Player.scala b/src/main/scala/li/cil/oc/server/component/robot/Player.scala index 2d950bc4f..7c7a64e6a 100644 --- a/src/main/scala/li/cil/oc/server/component/robot/Player.scala +++ b/src/main/scala/li/cil/oc/server/component/robot/Player.scala @@ -128,13 +128,11 @@ class Player(val robot: tileentity.Robot) extends FakePlayer(robot.world.asInsta false } !cancel && callUsingItemInSlot(0, stack => { - val current = getCurrentEquippedItem - val result = isItemUseAllowed(stack) && (entity.interactFirst(this) || (entity match { - case living: EntityLivingBase if current != null => current.func_111282_a(this, living) + case living: EntityLivingBase if getCurrentEquippedItem != null => getCurrentEquippedItem.func_111282_a(this, living) case _ => false })) - if (current != null && current.stackSize <= 0) { + if (getCurrentEquippedItem != null && getCurrentEquippedItem.stackSize <= 0) { destroyCurrentEquippedItem() } result