Skip to content

Commit

Permalink
fix: setting weapon index also in case weapon already exists in inven…
Browse files Browse the repository at this point in the history
…tory (#5)
  • Loading branch information
jakub-pukovec authored Sep 20, 2024
1 parent 534a66d commit 2537e61
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions player/weapon_pivot.gd
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func _process(_delta: float) -> void:
func add_weapon(new_weapon: PackedScene) -> void:
for weapon_type in _weapons:
if weapon_type.resource_path == new_weapon.resource_path:
_set_weapon_index(_weapons.find(new_weapon))
return

_weapons.append(new_weapon)
Expand Down

0 comments on commit 2537e61

Please sign in to comment.