Small refactor
This commit is contained in:
parent
82539c5af8
commit
c0489d405b
7 changed files with 11 additions and 15 deletions
|
|
@ -81,7 +81,7 @@ func get_empty_ability_slot() -> StringName:
|
|||
|
||||
func can_add_ability(ability: StringName, slot: StringName) -> bool:
|
||||
for ability_slot in ["ability_first","ability_second","ability_third"]:
|
||||
if slots[ability_slot] != null and slots[ability_slot].registry_entry == ability:
|
||||
if slots[ability_slot] != null and slots[ability_slot].weapon_gid == ability:
|
||||
return false
|
||||
return can_add(slot)
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ func drop(weapon: WeaponSubStateMachine) -> void:
|
|||
if slots.find_key(weapon) in ["knife","ability_first","ability_second","ability_third"]:
|
||||
return
|
||||
|
||||
var dropped_weapon: DroppableWeapon = Registry.weapons[weapon.registry_entry].dropped_scene.instantiate()
|
||||
var dropped_weapon: DroppableWeapon = Registry.weapons[weapon.weapon_gid].dropped_scene.instantiate()
|
||||
dropped_weapon.weapon.ammo = weapon.ammo
|
||||
dropped_weapon.weapon.remaining_ammo = weapon.remaining_ammo
|
||||
dropped_weapon.weapon.slot = weapon.slot
|
||||
|
|
@ -172,7 +172,7 @@ func notify_slots_updated():
|
|||
if slots[key] == null:
|
||||
display_slots[key] = ""
|
||||
else:
|
||||
display_slots[key] = slots[key].registry_entry
|
||||
display_slots[key] = slots[key].weapon_gid
|
||||
var current_slot: StringName = ""
|
||||
var found = slots.find_key(current_state)
|
||||
if found:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue