Remove AI multiplayer

This commit is contained in:
JonShard
2026-07-29 10:57:35 +02:00
parent ea492f914b
commit 0f1f0c6a93
102 changed files with 1146 additions and 960 deletions
+10 -7
View File
@@ -1,6 +1,6 @@
extends StaticBody3D
const RECIPE_MANAGER = preload("res://RecipeManager.gd")
const RECIPE_MANAGER = preload("res://scripts/recipe_Manager.gd")
@export var cook_speed = 1
@onready var snap_zone: XRToolsSnapZone = $XRToolsSnapZone
@@ -70,7 +70,7 @@ func _refresh_display() -> void:
func _on_object_picked_up(_item) -> void:
print("Hob: object picked up: ", _item)
# Find the CookableItem in held object
# Find the FoodItem in held object
var _food_item = _item.get_node_or_null("FoodItem") as FoodItem
if not _food_item:
print("Hob: held object is not a FoodItem")
@@ -94,8 +94,8 @@ func _on_object_dropped() -> void:
func convert_held_to_item(_item: String) -> void:
if not NetworkManager.owns_world():
return
#if not NetworkManager.owns_world():
#return
print("Hob converting ", _item)
var old_pickable = snap_zone.picked_up_object
@@ -106,12 +106,15 @@ func convert_held_to_item(_item: String) -> void:
# Spawn the new item through the server so it replicates to every peer
# (including late joiners), in the old item's position.
var original_transform = old_pickable.global_transform
var new_scene_instance = NetworkManager.spawn_item(RECIPE_MANAGER.get_item_scene(_item).resource_path, original_transform)
#var new_scene_instance = NetworkManager.spawn_item(RECIPE_MANAGER.get_item_scene(_item).resource_path, original_transform)
var new_scene_instance = RECIPE_MANAGER.get_item_scene(_item).instantiate()
get_tree().root.add_child(new_scene_instance)
new_scene_instance.transform = original_transform
# Drop and free the old item and pick up the new one
print("Hob freeing old_pickable ", old_pickable)
snap_zone.drop_object()
NetworkManager.despawn_item(old_pickable)
old_pickable.queue_free()
snap_zone.pick_up_object(new_scene_instance)