Amount check
This commit is contained in:
parent
d918533ebe
commit
82539c5af8
3 changed files with 15 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue