From 336ae08cd027ac65e12c3e66f663c2e1074114f2 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Tue, 28 May 2019 00:57:28 +0200 Subject: [PATCH] Use remote threads on supported platforms --- Scenes/Global/Remote.gd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Scenes/Global/Remote.gd b/Scenes/Global/Remote.gd index c303bd3..1b27b13 100644 --- a/Scenes/Global/Remote.gd +++ b/Scenes/Global/Remote.gd @@ -18,6 +18,9 @@ func fetch(url: String, cbObj: Object, cbFn: String): cbObj.call(cbFn, HTTPRequest.RESULT_SUCCESS, 200, [], buf) return var req := HTTPRequest.new() + # On HTML5 we cannot use threaded requests + # On other platforms (such as Android), we *need* to! + req.use_threads = !OS.has_feature("HTML5") add_child(req) req.connect("request_completed", self, "_request_completed", [url, cbObj, cbFn]) req.request(url)