Fix session loading after all other dependencies and hanging the level load

This commit is contained in:
Nick Winter 2016-09-11 09:16:50 -07:00
parent 4eed50f92a
commit c86c3c4628

View file

@ -209,8 +209,12 @@ module.exports = class LevelLoader extends CocoClass
console.log "Pushing resource: ", heroResource if LOG
@worldNecessities.push heroResource
@sessionDependenciesRegistered[session.id] = true
unless @level.isType('hero', 'hero-ladder', 'hero-coop')
# Return before loading heroConfig ThangTypes. Finish if all world necessities were completed by the time the session loaded.
if @checkAllWorldNecessitiesRegisteredAndLoaded()
@onWorldNecessitiesLoaded()
return
return unless @level.isType('hero', 'hero-ladder', 'hero-coop')
# Load the ThangTypes needed for the session's heroConfig for these types of levels
heroConfig = session.get('heroConfig')
heroConfig ?= me.get('heroConfig') if session is @session and not @headless
heroConfig ?= {}