Browse Source

isConsumable not used as driven by switch.

combat-2
MagicBot 8 months ago
parent
commit
6806ae3dc0
  1. 12
      src/engine/net/client/handlers/ObjectActionMsgHandler.java

12
src/engine/net/client/handlers/ObjectActionMsgHandler.java

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
package engine.net.client.handlers;
import engine.Enum;
import engine.Enum.ItemType;
import engine.exception.MsgSendException;
import engine.gameManager.*;
import engine.math.Bounds;
@ -75,16 +74,8 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler { @@ -75,16 +74,8 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
return true;
}
ItemBase ib = item.getItemBase();
if (ib == null) {
return true;
}
if (itemMan.doesCharOwnThisItem(item.getObjectUUID())) {
if (ib.isConsumable() || item.template.item_type.equals(ItemType.REAGENT)) {
int uuid = item.templsteID;
switch (item.template.item_type) {
@ -273,7 +264,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler { @@ -273,7 +264,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
// test character targeted
if (ib.getUUID() == 910005) {
if (item.template.template_id == 910005) {
// test for valid target type
if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter)
@ -316,7 +307,6 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler { @@ -316,7 +307,6 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
// itemMan.consume(item);
}
}
} else {
// TODO log item does not belong to player
// System.out.println("Item does not belong to player");

Loading…
Cancel
Save