Fixed the LevelLoader in headless settings.

This commit is contained in:
Scott Erickson 2014-05-20 11:25:32 -07:00
parent 93c6f72f07
commit 3f884e71e5

View file

@ -171,10 +171,12 @@ module.exports = class LevelLoader extends CocoClass
someLeft = true
thangType = spriteSheetResource.thangType
if thangType.loaded and not thangType.loading
@listenTo spriteSheetResource.thangType, 'build-complete', @onBuildComplete
keys = @buildSpriteSheetsForThangType spriteSheetResource.thangType
if keys and keys.length
@listenTo spriteSheetResource.thangType, 'build-complete', @onBuildComplete
spriteSheetResource.spriteSheetKeys = keys
spriteSheetResource.markLoaded() if keys.length is 0
else
spriteSheetResource.markLoaded()
clearInterval @buildLoopInterval unless someLeft