Tools get deactivated from animation when switching to an empty slot in the inventory. Also fixed layering (AGAIN)
This commit is contained in:
@@ -46,23 +46,21 @@ public partial class VesnaBehaviour2D : Node
|
||||
{
|
||||
InventorySlot currentSlot = InventoryManager.Instance.GetCurrentSelectedSlot();
|
||||
ItemInstance? currentItem = currentSlot.itemInstance;
|
||||
|
||||
if (currentItem == null)
|
||||
return;
|
||||
|
||||
|
||||
int toolId = -1;
|
||||
|
||||
if (currentItem.blueprint == _hoe)
|
||||
if (currentItem != null && currentItem.blueprint == _hoe)
|
||||
{
|
||||
toolId = 0;
|
||||
}
|
||||
|
||||
if (currentItem.blueprint == _wateringCan)
|
||||
if (currentItem != null && currentItem.blueprint == _wateringCan)
|
||||
{
|
||||
toolId = 1;
|
||||
}
|
||||
|
||||
ActivateTool(toolId);
|
||||
_vesnaAnimations.ActivateTool(toolId >= 0, toolId);
|
||||
EmitSignal(SignalName.InventorySelectionChanged, toolId);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user