From 5573cf635f37462e8c54c0672a8e105e4c12f1fa Mon Sep 17 00:00:00 2001 From: Clement Denis Date: Sat, 13 Jun 2020 00:05:29 +0200 Subject: [PATCH] tron: fix generated url + avoid crash on 404 --- subjects/tron/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/tron/index.html b/subjects/tron/index.html index 17736672..4213e1c2 100644 --- a/subjects/tron/index.html +++ b/subjects/tron/index.html @@ -217,7 +217,7 @@ const toBlob = async r => { const memo = {} const fetchBlob = url => memo[url] || (memo[url] = fetch(url).then(toBlob)) const remoteURL = (login, sha) => - `${location.origin}/${login}/tron/raw/branch/${sha || 'master'}/ai.js` + `https://git.${location.host}/${login}/tron/raw/branch/${sha || 'master'}/ai.js` const formatURL = url => { if (url.startsWith('/')) return `${location.pathname}/ai/${url}` @@ -318,7 +318,7 @@ const start = async ({ urls, seed }) => { } } catch (err) { console.error(err) - kill('FAILED-TO-LOAD') + return kill('FAILED-TO-LOAD') } move(ai.x, ai.y, ai.color, turn)