small racing game im working on
Diffstat (limited to 'ui/editor/export.gd')
-rw-r--r--ui/editor/export.gd8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/editor/export.gd b/ui/editor/export.gd
index 371fbfa..c92ad06 100644
--- a/ui/editor/export.gd
+++ b/ui/editor/export.gd
@@ -15,7 +15,7 @@ static func td2s(td: TrackResource) -> String:
static func s2td(s: String) -> TrackResource:
var split := s.lstrip('`').rstrip('`').strip_edges().split("|", false, 1)
- if not split.size() || split[0].length() < 100:
+ if not split.size() || split[0].length() < 80 || split[0].length() % 4 != 0 || EditorMarshalling.contains(split[0], " \n\t\r"):
return null
var buf := Marshalls.base64_to_raw(split[0])
if buf.size() < 100:
@@ -31,3 +31,9 @@ static func s2td(s: String) -> TrackResource:
if d is Dictionary:
return TrackResource.from_d(d)
return null
+
+static func contains(s: String, chars: String) -> bool:
+ for c in chars:
+ if s.contains(c):
+ return true
+ return false