diff --git a/Scripts/Weapons/Weapon3D.cs b/Scripts/Weapons/Weapon3D.cs index 76d1f07c..0c9b01f5 100644 --- a/Scripts/Weapons/Weapon3D.cs +++ b/Scripts/Weapons/Weapon3D.cs @@ -41,7 +41,7 @@ public partial class Weapon3D : Node3D private set { _loadedAmmo = value; - _inventoryManager?.NotifyLoadedAmmoChange(WeaponData?.ItemKey, _loadedAmmo); + InventoryManager.Instance?.NotifyLoadedAmmoChange(WeaponData?.ItemKey, _loadedAmmo); } } @@ -51,8 +51,6 @@ public partial class Weapon3D : Node3D private GameManager _gameManager; - private InventoryManager _inventoryManager; - private readonly StringName _shieldAmmoType = "SHIELD"; private bool UsesBattery => WeaponData.AmmoKey == _shieldAmmoType; @@ -80,7 +78,7 @@ public partial class Weapon3D : Node3D } else { - var ammoToLoad = _inventoryManager.RemoveItem(WeaponData.AmmoKey, WeaponData.BulletCapacity - LoadedAmmo); + var ammoToLoad = InventoryManager.Instance.RemoveItem(WeaponData.AmmoKey, WeaponData.BulletCapacity - LoadedAmmo); if (ammoToLoad > 0) {