Browse Source

isConsumable not used as driven by switch.

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

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

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

Loading…
Cancel
Save