Merge pull request 'Made select_runner() an RPC call #27' (#30) from potential-fix-to-#27 into main

Reviewed-on: The_Adventures_of_Teddy/Project_Teddy#30
This commit is contained in:
Paul Black 2023-03-17 02:43:46 +00:00
commit 12a7bb4a8e

View file

@ -35,7 +35,7 @@ func _process(delta):
if Global.gamemode == "Runner":
if runnerSelected == false:
runnerSelected = true
select_runner(Global.connectedPlayers, Global.connectedPlayersByPeerID)
rpc("select_runner", Global.connectedPlayers, Global.connectedPlayersByPeerID)
if Global.runnerDead == true:
print("RUNNER IS DEAD")
rpc("runner_dead", Global.chosenRunner)
@ -74,6 +74,7 @@ func fill_scores_with_zeros(num_of_players):
for i in num_of_players:
scores[i] = 0
@rpc("authority", "reliable", "call_local")
func select_runner(players, playersID):
var numOfPlayers = players.size()
var getIndexSize = numOfPlayers - 1