diff --git a/scenes/base_track_level.gd b/scenes/base_track_level.gd index 6607c5c..932211c 100644 --- a/scenes/base_track_level.gd +++ b/scenes/base_track_level.gd @@ -10,7 +10,7 @@ onready var track = $Track func _ready() -> void: - reset_player_to(track.get_last_checkpoint(), player_node) + reset_player_to(track.get_furthest_checkpoint(), player_node) add_child(player_node) add_child(gui) var player_camera = CAMERA.instance() @@ -38,9 +38,9 @@ func reset_player_to(node_to_reset_to: Node, player_node: BuggedVehicle) -> void func _process(_delta: float) -> void: if Input.is_action_just_released("reset_vehicle"): - reset_player_to(track.get_last_checkpoint(), player_node) + reset_player_to(track.get_furthest_checkpoint(), player_node) func _on_ResetArea_body_entered(body: Node) -> void: if body.get_groups().has("car"): - reset_player_to(track.get_last_checkpoint(), body) + reset_player_to(track.get_furthest_checkpoint(), body) diff --git a/scenes/tracks/track.gd b/scenes/tracks/track.gd index c35a4c0..bd80fc9 100644 --- a/scenes/tracks/track.gd +++ b/scenes/tracks/track.gd @@ -22,8 +22,8 @@ onready var checkpoints = $Checkpoints onready var path: Path = get_node(track_path) -func get_last_checkpoint() -> Node: - return checkpoints.get_child(max(0, last_checkpoint)) +func get_furthest_checkpoint() -> Node: + return checkpoints.get_child(max(0, furthest_checkpoint)) func _ready() -> void: