Open Poryg1 opened 6 years ago
Thx!
I do not think that this method is redundant because it is trying to run XMLHttpRequest
correctly.
For example, if you play a game on the local system (URL starts with file:///
) on Chrome, you can read the file using the <script>
tag, but XMLHttpRequest
is forbidden.
So, canReadGameFiles
is still necessary.
But, in fact, this method is not working correctly because the forbidden XMLHttpRequest
raises an error asynchronously, so try - catch
statements can not catch errors.
This may have to be fixed ;-)
Oh, I see, forgot about that one :D Well, in that case the fix is not too difficult at least, on AudioManager it was solved via onError.bind.
What this method does is:
However, if the target script cannot be loaded, rpg_core.js cannot be loaded either. And when rpg_core.js is not loaded, Utils.canReadGameFiles cannot be executed. Therefore this function is completely redundant, since if loading worked perfectly, we will see it, and if not, this function cannot even execute to check for it. I also removed the code from SceneManager to make sure the game won't crash from removing the utils method.