diff --git a/scenes/main.gd b/scenes/main.gd index 35c4a1e..982ff47 100644 --- a/scenes/main.gd +++ b/scenes/main.gd @@ -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) diff --git a/scenes/player.gd b/scenes/player.gd index d116baf..529691b 100644 --- a/scenes/player.gd +++ b/scenes/player.gd @@ -400,10 +400,11 @@ func initialize_random_goals(_size:int, min_value:int, max_value:int, null_count return result # Remove this since goals are now set by main.gd -#func append_random_goals(): -# goals.append_array(initialize_random_goals(9, 7, 10, 1.0)) -# if is_multiplayer_authority(): -# rpc("sync_goals", goals) +func append_random_goals(): + goals.append_array(initialize_random_goals(9, 7, 10, 1.0)) + + if is_multiplayer_authority(): + rpc("sync_goals", goals) func bot_try_grab_item() -> bool: if not enhanced_gridmap or action_points <= 0: