🐛 fixed ObjectDisposedException from the Inventory when switching scenes.

This commit is contained in:
2025-10-29 16:03:36 +01:00
parent e202534c6b
commit 02b6584e44
2 changed files with 15 additions and 18 deletions
@@ -32,6 +32,11 @@ public partial class VesnaBehaviour2D : Node
_inventoryManager.SlotIndexChanged += HandleInventorySelectedSlotIndexChanged;
}
public override void _ExitTree()
{
_inventoryManager.SlotIndexChanged -= HandleInventorySelectedSlotIndexChanged;
}
/// <summary>
/// Called when picking up an item.
/// Makes sure that item animations are also updated when they are occupying a currently empty spot.