mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-01 17:01:53 +08:00
fix(物品系统): 修复物品收集和库存上限问题
在EntityBase.gd中添加物品数量上限检查,防止库存溢出 在ItemDropped.gd中增加收集条件,仅在库存未满时收集物品
This commit is contained in:
@@ -362,7 +362,7 @@ func useItem(items: Dictionary):
|
||||
return state
|
||||
func getItem(items: Dictionary):
|
||||
for item in items:
|
||||
inventory[item] += items[item]
|
||||
inventory[item] = clamp(inventory[item] + items[item], 0, inventoryMax[item])
|
||||
|
||||
func getTrackingAnchor() -> Vector2:
|
||||
return hurtbox.get_node("hitbox").global_position
|
||||
|
||||
Reference in New Issue
Block a user