Fixed #958. LevelLoader wasn't handling cached session objects passed in with the supermodel.
This commit is contained in:
parent
ff51f18a90
commit
c037ce14f2
1 changed files with 4 additions and 4 deletions
|
@ -59,13 +59,13 @@ module.exports = class LevelLoader extends CocoClass
|
||||||
url = "/db/level/#{@levelID}/session"
|
url = "/db/level/#{@levelID}/session"
|
||||||
url += "?team=#{@team}" if @team
|
url += "?team=#{@team}" if @team
|
||||||
|
|
||||||
@session = new LevelSession().setURL url
|
session = new LevelSession().setURL url
|
||||||
@supermodel.loadModel(@session, 'level_session', {cache:false})
|
@session = @supermodel.loadModel(session, 'level_session', {cache:false}).model
|
||||||
@session.once 'sync', -> @url = -> '/db/level.session/' + @id
|
@session.once 'sync', -> @url = -> '/db/level.session/' + @id
|
||||||
|
|
||||||
if @opponentSessionID
|
if @opponentSessionID
|
||||||
@opponentSession = new LevelSession().setURL "/db/level_session/#{@opponentSessionID}"
|
opponentSession = new LevelSession().setURL "/db/level_session/#{@opponentSessionID}"
|
||||||
@supermodel.loadModel(@opponentSession, 'opponent_session')
|
@opponentSession = @supermodel.loadModel(opponentSession, 'opponent_session').model
|
||||||
|
|
||||||
# Supermodel (Level) Loading
|
# Supermodel (Level) Loading
|
||||||
|
|
||||||
|
|
Reference in a new issue