Amount check

This commit is contained in:
Rendo 2025-12-12 02:15:02 +05:00
commit 82539c5af8
3 changed files with 15 additions and 2 deletions

View file

@ -17,11 +17,14 @@ func buy(player_id: int, weapon: WeaponResource) -> void:
match weapon.slot:
"ability":
slot = weapon_system.get_empty_ability_slot()
if not weapon_system.can_add_ability(weapon.get_gid(),slot):
return
var anything:
slot = anything
if not weapon_system.can_add(slot):
return
if not weapon_system.can_add(slot):
return
var player_data = Session.player_data[player_id]
player_data["money"] -= weapon.cost