Koenvh1 / ets2-local-radio

Radio from wherever you are in ETS2/ATS
https://koenvh.nl/projects/ets2-local-radio
Mozilla Public License 2.0
220 stars 41 forks source link

Local Radio v4.0.0 working with ETS2 but not with ATS: JavaScript error #226

Open DoctorStrange96 opened 2 months ago

DoctorStrange96 commented 2 months ago

As written in the title. I was able to reproduce this issue using version 3.4.2 as well. I can find and listen to local radio stations just fine in ETS2, but I run into the "Waiting for your in-game coordinates..." issue in ATS.

Upon inspecting the console via MS Edge Dev Tools (I'm using the latest version of Edge x64 – at the moment I'm writing this issue, the version number is 124.0.2478.80), the following error repeats itself:

main.js:214 Uncaught TypeError: Cannot read properties of undefined (reading 'relative_radius') at refresh (main.js:214:90) at Object.success (main.js:82:13) at fire (jquery-3.1.1.js:3305:31) at Object.fireWith [as resolveWith] (jquery-3.1.1.js:3435:7) at done (jquery-3.1.1.js:9242:14) at XMLHttpRequest. (jquery-3.1.1.js:9484:9)

Deleting the relative_radius variable in this particular line solves the issue. Maybe we don't need that variable for ATS at all?

Koenvh1 commented 2 months ago

Hmm, I've quickly tried reproducing it, but have not managed to do so so far.

Koenvh1 commented 2 months ago

Does this fix it? https://github.com/Koenvh1/ets2-local-radio/commit/ae25bb855d783173aeee774e1eee4f8c21f1dbac