Require typed consumable rows for action bar binding
This commit is contained in:
parent
15feb02863
commit
d5330348e2
3 changed files with 10 additions and 8 deletions
|
|
@ -729,7 +729,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
slot.Binding = new ActionBarGearBinding(CurrentEntity, slot, equippedItemDragAction.EquippedItem, trigger);
|
||||
return true;
|
||||
case ItemInstanceDragObject itemInstanceDragAction:
|
||||
if (!IsTypedConsumable(itemInstanceDragAction.Item)) return false;
|
||||
if (!IsRuntimeConsumableItem(itemInstanceDragAction.Item)) return false;
|
||||
if (!(ItemManager.GetData(itemInstanceDragAction.Item) is ConsumableItemData consumable)) return false;
|
||||
slot.Binding = new ActionBarConsumableBinding(CurrentEntity, slot, consumable);
|
||||
return true;
|
||||
|
|
@ -749,10 +749,10 @@ public class ActionGameManager : MonoBehaviour
|
|||
return slot;
|
||||
}
|
||||
|
||||
bool IsTypedConsumable(ItemInstance item)
|
||||
bool IsRuntimeConsumableItem(ItemInstance item)
|
||||
{
|
||||
var typedItem = FindTypedActionBarItem(item);
|
||||
return typedItem == null ||
|
||||
return typedItem != null &&
|
||||
string.Equals(typedItem.Category, nameof(ConsumableItemData), StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue