Remove AI multiplayer
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
class_name ItemContainer
|
||||
extends Node3D
|
||||
|
||||
const RECIPE_MANAGER = preload("res://scripts/recipe_Manager.gd")
|
||||
|
||||
@export var enabled: bool = true
|
||||
@export var target_group : String # Items with this tag can be added to the container
|
||||
@export var meal_positions: Array[Node3D] = []
|
||||
@@ -27,8 +29,8 @@ func _ready() -> void:
|
||||
# Absorbing items is a server decision (the container's holder is server-
|
||||
# snapped into a station, matching table.gd/hob.gd's convention).
|
||||
func _on_body_entered(body: Node3D) -> void:
|
||||
if not NetworkManager.owns_world():
|
||||
return
|
||||
#if not NetworkManager.owns_world():
|
||||
#return
|
||||
print("Container enabled: ", enabled)
|
||||
if not enabled:
|
||||
print("Container disabled in _on_body_entered body")
|
||||
@@ -90,7 +92,7 @@ func _add_item(item: Node3D) -> void:
|
||||
updated.append(food_node.id)
|
||||
plate_controller.contained_ids = updated
|
||||
|
||||
NetworkManager.despawn_item(item)
|
||||
item.queue_free()
|
||||
|
||||
|
||||
func erase_item(item: FoodItem) -> void:
|
||||
@@ -122,7 +124,7 @@ func refresh_visuals(ids: Array[String]) -> void:
|
||||
var meal_idx := 0
|
||||
var side_idx := 0
|
||||
for id in ids:
|
||||
var scene := RecipeManager.get_item_scene(id)
|
||||
var scene := RECIPE_MANAGER.get_item_scene(id)
|
||||
if not scene:
|
||||
continue
|
||||
var visual := scene.instantiate()
|
||||
@@ -195,7 +197,7 @@ func _remove_from_physics(visual: Node3D) -> void:
|
||||
PhysicsServer3D.body_set_space((visual as RigidBody3D).get_rid(), RID())
|
||||
var despawning_item = visual.get_node_or_null("DespawningItem")
|
||||
if despawning_item:
|
||||
NetworkManager.despawn_item(despawning_item)
|
||||
despawning_item.queue_free()
|
||||
|
||||
|
||||
#plate (Pickalbe)
|
||||
|
||||
Reference in New Issue
Block a user