This commit is contained in:
Scott Erickson 2014-03-06 16:22:19 -08:00
commit 2fb1c184f9
2 changed files with 3 additions and 1 deletions

View file

@ -30,7 +30,7 @@ module.exports = class God
@createWorld()
fillWorkerPool: =>
return unless Worker
return unless Worker and not @dead
@workerPool ?= []
if @workerPool.length < @maxWorkerPoolSize
@workerPool.push @createWorker()

View file

@ -70,6 +70,7 @@ module.exports = class LevelLoader extends CocoClass
@session.loaded and ((not @opponentSession) or @opponentSession.loaded)
onSessionLoaded: ->
return if @destroyed
# TODO: maybe have all non versioned models do this? Or make it work to PUT/PATCH to relative urls
if @session.loaded
@session.url = -> '/db/level.session/' + @id
@ -171,6 +172,7 @@ module.exports = class LevelLoader extends CocoClass
t0 = new Date()
@spriteSheetsToBuild += 1
thangType.once 'build-complete', =>
return if @destroyed
@spriteSheetsBuilt += 1
@notifyProgress()
console.log "Built", thangType.get('name'), 'after', ((new Date()) - t0), 'ms'