diff --git a/main.gd b/main.gd index 433d90e..eef6891 100644 --- a/main.gd +++ b/main.gd @@ -107,12 +107,14 @@ func repopulate_levels(): level_select.clear() for level in levels.chapters[current_chapter].levels: level_select.add_item(level.slug) + level_select.select(current_level) func repopulate_chapters(): levels.reload() chapter_select.clear() for c in levels.chapters: chapter_select.add_item(c.slug) + chapter_select.select(current_chapter) func update_repos(): for r in repositories: diff --git a/repository.gd b/repository.gd index 587c933..b90883d 100644 --- a/repository.gd +++ b/repository.gd @@ -157,8 +157,9 @@ func update_node_positions(): objects[ref].position = Vector2(target.position.x ,target.position.y - 100) var target_reference = objects["HEAD"].children.keys()[0] - var target = objects[target_reference] - objects["HEAD"].position = Vector2(target.position.x ,target.position.y - 100) + if objects.has(target_reference): + var target = objects[target_reference] + objects["HEAD"].position = Vector2(target.position.x ,target.position.y - 100)