mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 10:56:53 -05:00
Fixes for updating paths during world streaming.
This commit is contained in:
parent
aab51178e2
commit
f5b5ee2206
4 changed files with 13 additions and 5 deletions
|
@ -130,7 +130,7 @@ module.exports = class Angel extends CocoClass
|
||||||
eventType = if finished then 'god:new-world-created' else 'god:streaming-world-updated'
|
eventType = if finished then 'god:new-world-created' else 'god:streaming-world-updated'
|
||||||
if finished
|
if finished
|
||||||
@shared.world = world
|
@shared.world = world
|
||||||
Backbone.Mediator.publish eventType, world: world, firstWorld: @shared.firstWorld, goalStates: goalStates, team: me.team, firstChangedFrame: firstChangedFrame
|
Backbone.Mediator.publish eventType, world: world, firstWorld: @shared.firstWorld, goalStates: goalStates, team: me.team, firstChangedFrame: firstChangedFrame, finished: finished
|
||||||
if finished
|
if finished
|
||||||
for scriptNote in @shared.world.scriptNotes
|
for scriptNote in @shared.world.scriptNotes
|
||||||
Backbone.Mediator.publish scriptNote.channel, scriptNote.event
|
Backbone.Mediator.publish scriptNote.channel, scriptNote.event
|
||||||
|
|
|
@ -455,7 +455,10 @@ module.exports = Surface = class Surface extends CocoClass
|
||||||
else
|
else
|
||||||
@fastForwardingToFrame = @fastForwardingSpeed = null
|
@fastForwardingToFrame = @fastForwardingSpeed = null
|
||||||
# console.log "on new world, lag", lag, "intended lag", intendedLag, "fastForwardingToFrame", @fastForwardingToFrame, "speed", @fastForwardingSpeed, "cause we are at", @world.age, "of", @world.frames.length * @world.dt
|
# console.log "on new world, lag", lag, "intended lag", intendedLag, "fastForwardingToFrame", @fastForwardingToFrame, "speed", @fastForwardingSpeed, "cause we are at", @world.age, "of", @world.frames.length * @world.dt
|
||||||
@updatePaths()
|
if event.finished
|
||||||
|
@updatePaths()
|
||||||
|
else
|
||||||
|
@hidePaths()
|
||||||
|
|
||||||
onIdleChanged: (e) ->
|
onIdleChanged: (e) ->
|
||||||
@setPaused e.idle unless @ended
|
@setPaused e.idle unless @ended
|
||||||
|
|
|
@ -472,9 +472,13 @@ module.exports = class World
|
||||||
|
|
||||||
perf.t1 = now()
|
perf.t1 = now()
|
||||||
if w.thangs.length
|
if w.thangs.length
|
||||||
for thangConfig in o.thangs when not w.thangMap[thangConfig.id]
|
for thangConfig in o.thangs
|
||||||
w.thangs.push thang = Thang.deserialize(thangConfig, w, classMap, level.levelComponents)
|
if thang = w.thangMap[thangConfig.id]
|
||||||
w.setThang thang
|
for prop, val of thangConfig.finalState
|
||||||
|
thang[prop] = val
|
||||||
|
else
|
||||||
|
w.thangs.push thang = Thang.deserialize(thangConfig, w, classMap, level.levelComponents)
|
||||||
|
w.setThang thang
|
||||||
else
|
else
|
||||||
w.thangs = (Thang.deserialize(thang, w, classMap, level.levelComponents) for thang in o.thangs)
|
w.thangs = (Thang.deserialize(thang, w, classMap, level.levelComponents) for thang in o.thangs)
|
||||||
w.setThang thang for thang in w.thangs
|
w.setThang thang for thang in w.thangs
|
||||||
|
|
|
@ -24,6 +24,7 @@ worldUpdatedEventSchema = c.object {required: ['world', 'firstWorld', 'goalState
|
||||||
goalStates: goalStatesSchema
|
goalStates: goalStatesSchema
|
||||||
team: {type: 'string'}
|
team: {type: 'string'}
|
||||||
firstChangedFrame: {type: 'integer', minimum: 0}
|
firstChangedFrame: {type: 'integer', minimum: 0}
|
||||||
|
finished: {type: 'boolean'}
|
||||||
|
|
||||||
module.exports =
|
module.exports =
|
||||||
'god:user-code-problem': c.object {required: ['problem']},
|
'god:user-code-problem': c.object {required: ['problem']},
|
||||||
|
|
Loading…
Reference in a new issue