aboutsummaryrefslogtreecommitdiffstats
path: root/Scripts
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@blos.sm>2023-07-09 16:54:44 +0100
committerLibravatar cel 🌸 <cel@blos.sm>2023-07-09 16:54:44 +0100
commit859563f6ad4370a7f5f96963d63f4d83eecad9a4 (patch)
tree58e6547ec852ac3176fa1ffb92c7ab18022d435a /Scripts
parent6b6d02ead8b1f5b0f5cf44d0a88abe50769128ca (diff)
download2023-859563f6ad4370a7f5f96963d63f4d83eecad9a4.tar.gz
2023-859563f6ad4370a7f5f96963d63f4d83eecad9a4.tar.bz2
2023-859563f6ad4370a7f5f96963d63f4d83eecad9a4.zip
fix crash
Diffstat (limited to '')
-rw-r--r--Scripts/Road.gd4
-rw-r--r--Scripts/drawing.gd3
2 files changed, 6 insertions, 1 deletions
diff --git a/Scripts/Road.gd b/Scripts/Road.gd
index 4b19c70..db60c7d 100644
--- a/Scripts/Road.gd
+++ b/Scripts/Road.gd
@@ -80,3 +80,7 @@ func draw_borders():
leftBorder.add_point(point)
point = points[pointIndex] - (normal*50)
rightBorder.add_point(point)
+
+func clear_borders():
+ leftBorder.clear_points()
+ rightBorder.clear_points()
diff --git a/Scripts/drawing.gd b/Scripts/drawing.gd
index 6b94f6e..612ba60 100644
--- a/Scripts/drawing.gd
+++ b/Scripts/drawing.gd
@@ -2,7 +2,7 @@ extends Node
var drawing = false
-@onready var line = $Road
+@onready var line = $TrackLine
@onready var path: Path2D = $TrackPath
func _ready():
@@ -34,4 +34,5 @@ func _input(event):
func reset():
line.clear_points()
+ line.clear_borders()
path.curve.clear_points()