Jump to content

why is isLoading not set to false when loader.start is called with no parameters


Daltrey Waters
 Share

Recommended Posts

Hello,

 

i've noticed that on Loader's start function when the length of the file list is 0, it doesn't set isLoading to false. However it does set hasLoaded to true.

Is the lack of the isLoading = true a bug or a by design behavior? if it's by design, can someone elaborate why?

 

Thanks

Link to comment
Share on other sites

This looks like an oversight to me - the code seems to be slightly flawed in the case of there not being any files to load: http://docs.phaser.io/Loader.js.html#sunlight-1-line-847

 

We see Loader.start() is called by StateManager, which sets isLoading to true, but then immediately if the file list is empty, hasLoaded is set to true but isLoading is not set back to false, as this is usually managed in nextFile (which is never called when the queue is empty) when no files are left.

 

Well spotted! I'll submit a PR for this to Github :)

 

Edit: Rich is way ahead of me :D

Edited by lewster32
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...