fix the occuring that client doesn't get goals on joined

This commit is contained in:
2025-02-18 11:34:36 +08:00
parent 330d5a401b
commit 1c8a6aab9f
2 changed files with 8 additions and 4 deletions
+3
View File
@@ -354,6 +354,9 @@ func add_player_character(peer_id):
var bot_to_replace = get_node_or_null(str(bots[0])) if bots.size() > 0 else null
if bot_to_replace:
player_character.goals = bot_to_replace.goals.duplicate()
else:
# Only generate new goals if not inheriting from a bot
player_character.append_random_goals()
func add_bot(bot_id):
rpc("create_bot", bot_id)