mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -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'
|
||||
if finished
|
||||
@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
|
||||
for scriptNote in @shared.world.scriptNotes
|
||||
Backbone.Mediator.publish scriptNote.channel, scriptNote.event
|
||||
|
|
|
@ -455,7 +455,10 @@ module.exports = Surface = class Surface extends CocoClass
|
|||
else
|
||||
@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
|
||||
@updatePaths()
|
||||
if event.finished
|
||||
@updatePaths()
|
||||
else
|
||||
@hidePaths()
|
||||
|
||||
onIdleChanged: (e) ->
|
||||
@setPaused e.idle unless @ended
|
||||
|
|
|
@ -472,9 +472,13 @@ module.exports = class World
|
|||
|
||||
perf.t1 = now()
|
||||
if w.thangs.length
|
||||
for thangConfig in o.thangs when not w.thangMap[thangConfig.id]
|
||||
w.thangs.push thang = Thang.deserialize(thangConfig, w, classMap, level.levelComponents)
|
||||
w.setThang thang
|
||||
for thangConfig in o.thangs
|
||||
if thang = w.thangMap[thangConfig.id]
|
||||
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
|
||||
w.thangs = (Thang.deserialize(thang, w, classMap, level.levelComponents) for thang in o.thangs)
|
||||
w.setThang thang for thang in w.thangs
|
||||
|
|
|
@ -24,6 +24,7 @@ worldUpdatedEventSchema = c.object {required: ['world', 'firstWorld', 'goalState
|
|||
goalStates: goalStatesSchema
|
||||
team: {type: 'string'}
|
||||
firstChangedFrame: {type: 'integer', minimum: 0}
|
||||
finished: {type: 'boolean'}
|
||||
|
||||
module.exports =
|
||||
'god:user-code-problem': c.object {required: ['problem']},
|
||||
|
|
Loading…
Reference in a new issue