Daltrey Waters Posted June 30, 2014 Share Posted June 30, 2014 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 More sharing options...
rich Posted June 30, 2014 Share Posted June 30, 2014 Probably more just an oversight, and as nothing should really be checking that property (but rather listening for the events instead) I guess no-one noticed it until now. Have added into the dev branch version. Link to comment Share on other sites More sharing options...
lewster32 Posted June 30, 2014 Share Posted June 30, 2014 (edited) 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 Edited June 30, 2014 by lewster32 Link to comment Share on other sites More sharing options...
Recommended Posts