Fixed the new build queue system for levels where there are multiple builders for a single thang type.

This commit is contained in:
Scott Erickson 2014-03-13 15:45:24 -07:00
parent b2e9768127
commit abd50b9495

View file

@ -138,7 +138,7 @@ module.exports = class ThangType extends CocoModel
key = @spriteSheetKey(@options)
spriteSheet = null
if @options.async
buildQueue.push @
buildQueue.push @builder
@builder.buildAsync() unless buildQueue.length > 1
@builder.on 'complete', @onBuildSpriteSheetComplete, @, true, key
return true
@ -150,7 +150,7 @@ module.exports = class ThangType extends CocoModel
onBuildSpriteSheetComplete: (e, key) ->
buildQueue = buildQueue.slice(1)
buildQueue[0]?.builder.buildAsync()
buildQueue[0]?.buildAsync()
@spriteSheets[key] = e.target.spriteSheet
delete @building[key]
@trigger 'build-complete'