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 someLeft = true
thangType = spriteSheetResource.thangType thangType = spriteSheetResource.thangType
if thangType.loaded and not thangType.loading if thangType.loaded and not thangType.loading
@listenTo spriteSheetResource.thangType, 'build-complete', @onBuildComplete
keys = @buildSpriteSheetsForThangType spriteSheetResource.thangType keys = @buildSpriteSheetsForThangType spriteSheetResource.thangType
spriteSheetResource.spriteSheetKeys = keys if keys and keys.length
spriteSheetResource.markLoaded() if keys.length is 0 @listenTo spriteSheetResource.thangType, 'build-complete', @onBuildComplete
spriteSheetResource.spriteSheetKeys = keys
else
spriteSheetResource.markLoaded()
clearInterval @buildLoopInterval unless someLeft clearInterval @buildLoopInterval unless someLeft