Devel Sync
This commit is contained in:
parent
3c0be2d800
commit
34588e132a
2 changed files with 10 additions and 5 deletions
|
@ -60,6 +60,7 @@ func _on_player_disconnected(id):
|
|||
if current_character.captured_by != null:
|
||||
current_character.captured_by.lost_one()
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
if is_instance_valid(current_character):
|
||||
current_character.free()
|
||||
x += 1
|
||||
Game.player_list.erase(id)
|
||||
|
|
|
@ -108,10 +108,12 @@ func start_game():
|
|||
var map = get_tree().root.get_node("./"+map_name+"/")
|
||||
for i in range(player_list.size()):
|
||||
var obj = objective.instantiate()
|
||||
obj.name = "objective" + str(i)
|
||||
obj.position = get_tree().root.get_node("./"+map_name+"/objective_spawns/"+str(i)).position
|
||||
map.add_child(obj)
|
||||
for i in range(player_list.size()):
|
||||
var obj = prison.instantiate()
|
||||
obj.name = "prison" + str(i)
|
||||
obj.position = get_tree().root.get_node("./"+map_name+"/prison_spawns/"+str(i)).position
|
||||
map.add_child(obj)
|
||||
var i = 0
|
||||
|
@ -142,10 +144,12 @@ func sync_player(node_path, position, rotation, rotation2):
|
|||
get_tree().root.get_node(node_path).find_child("collision").rotation = rotation2
|
||||
|
||||
func sync_hammer(node_path, rotation):
|
||||
if get_tree().root.has_node(node_path):
|
||||
var current_character = get_tree().root.get_node(node_path)
|
||||
current_character.rotation = rotation
|
||||
|
||||
func sync_computers(node_path, current):
|
||||
if get_tree().root.has_node(node_path):
|
||||
var current_character = get_tree().root.get_node(node_path)
|
||||
current_character.current = current
|
||||
|
||||
|
|
Loading…
Reference in a new issue