Prep for forgejo migration.
This commit is contained in:
parent
882ef67c42
commit
56d77fbb53
6 changed files with 324 additions and 83 deletions
|
|
@ -21,7 +21,7 @@ func join_game():
|
|||
multiplayer.multiplayer_peer = peer
|
||||
|
||||
func is_valid(sender_id, must_be_from_owner):
|
||||
if must_be_from_owner:
|
||||
if must_be_from_owner and Game.player_list.has(0):
|
||||
if sender_id == Game.player_list.keys()[0] or Game.is_server:
|
||||
return true
|
||||
for id in Game.player_list:
|
||||
|
|
@ -39,7 +39,7 @@ func _on_server_disconnected():
|
|||
func _on_player_disconnected(id):
|
||||
var x = 0
|
||||
for i in Game.player_list:
|
||||
if i == id:
|
||||
if i == id and get_tree().root.has_node("./"+Game.map_name+"/player"+str(x)):
|
||||
var current_character = get_tree().root.get_node("./"+Game.map_name+"/player"+str(x))
|
||||
if current_character.hp == 0:
|
||||
Game.dead -= 1
|
||||
|
|
@ -50,10 +50,10 @@ func _on_player_disconnected(id):
|
|||
Game.players = 0
|
||||
else:
|
||||
Game.players -= 1
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
current_character.free()
|
||||
if current_character.captured_by != null:
|
||||
current_character.captured_by.lost_one()
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
current_character.free()
|
||||
x += 1
|
||||
Game.player_list.erase(id)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue