mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-05 21:35:54 +00:00
Weapon inventory manager fix
This commit is contained in:
parent
cd16e67a47
commit
357ced3e94
1 changed files with 2 additions and 4 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue