person can take and interact with item

This commit is contained in:
Nikolai Fesenko
2025-08-19 13:58:34 +02:00
parent e4667a3a47
commit 31c9a69132
9 changed files with 97 additions and 36 deletions

View File

@@ -7,10 +7,11 @@ var shelfes: Array
func set_person_target_item(person,item_name):
var result = find_item(item_name)
print(result)
if result != null:
person.set_target(result.shelf_owner.owner)
result.is_being_used = true
person.target_item = result
person.set_target(result.shelf_owner)
func find_item(item_name):
@@ -18,7 +19,7 @@ func find_item(item_name):
for shelf in shelfes:
if shelf != null:
for item in shelf.stored_items:
if item.item_name == item_name:
if item.item_name == item_name and !item.is_being_used:
return item
return null