Fixed some script handling by not having playback changed when the first world is built.

This commit is contained in:
Scott Erickson 2014-02-25 10:50:12 -08:00
parent e63763d539
commit a1a5d5eea0

View file

@ -311,7 +311,10 @@ module.exports = Surface = class Surface extends CocoClass
onNewWorld: (event) ->
return unless event.world.name is @world.name
@casting = false
Backbone.Mediator.publish 'level-set-playing', { playing: @wasPlayingWhenCastingBegan }
# This has a tendency to break scripts that are waiting for playback to change when the level is loaded
# so only run it after the first world is created.
Backbone.Mediator.publish 'level-set-playing', { playing: @wasPlayingWhenCastingBegan } unless event.firstWorld
fastForwardTo = null
if @playing