mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-08 20:25:54 +00:00
Weapon equip fix
This commit is contained in:
parent
6d7282f5cb
commit
27fb8fb4bd
5 changed files with 14 additions and 6 deletions
|
|
@ -52,7 +52,13 @@ public partial class PlayerWeaponProvider : Node2D
|
|||
if (string.IsNullOrWhiteSpace(itemKey)) return;
|
||||
var weapon = EquippedWeapons.FirstOrDefault(x => x.WeaponData.ItemKey == itemKey);
|
||||
|
||||
if (weapon is null) return;
|
||||
if (weapon is null)
|
||||
{
|
||||
// Spawn a weapon
|
||||
InventoryManager.Instance.TryGetItem(itemKey, out var item);
|
||||
SpawnPlayerWeapon(item.Item);
|
||||
return;
|
||||
};
|
||||
|
||||
EquipWeapon(weapon);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue