Skip to content

Commit

Permalink
Brought in line with web rework
Browse files Browse the repository at this point in the history
  • Loading branch information
NancokPS2 committed Feb 11, 2024
1 parent a073a89 commit 32e2788
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions classes/Item.gd
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,14 @@ func server_use(player: Player) -> bool:
player.stats.heal(self.name, boost.hp)

if amount <= 1:
player.inventory.remove_item(uuid)
player.inventory.server_remove_item(uuid)
else:
player.inventory.set_item_amount(uuid, amount - 1)
player.inventory.server_change_item_amount(uuid, amount - 1)
return true

ITEM_TYPE.EQUIPMENT:
if player.equipment and player.equipment.server_equip_item(self):
player.inventory.server_remove_item(uuid)
return true

else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ func server_use_item(item_uuid: String):

var item: Item = get_item(item_uuid)
if item and item.server_use(_target_node):
server_remove_item(item_uuid)
return true

return false
Expand Down

0 comments on commit 32e2788

Please sign in to comment.