Proper swap, generic mouse confinment and win

This commit is contained in:
Rendo 2025-12-12 16:49:20 +05:00
commit 5df5633c27
16 changed files with 136 additions and 96 deletions

View file

@ -74,15 +74,17 @@ func set_teams(attack: Array[int],defence: Array[int],spectators: Array[int]):
defence_team = defence
specators_team = spectators
update_teams_state.emit()
if is_multiplayer_authority():
set_teams.rpc(attack,defence,spectators)
func switch_team(team: int) -> void:
team_switch_notification.rpc(multiplayer.get_unique_id(),team)
func swap_teams() -> void:
if not multiplayer.is_server():
if not is_multiplayer_authority():
return
set_teams.rpc(defence_team,attack_team,specators_team)
set_teams(defence_team,attack_team,specators_team)
@rpc("any_peer","call_local","reliable")
func team_switch_notification(id: int, team: int) -> void: