diff --git a/app/models/LevelSession.coffee b/app/models/LevelSession.coffee index ba87aef23..5d59d1bc2 100644 --- a/app/models/LevelSession.coffee +++ b/app/models/LevelSession.coffee @@ -42,3 +42,14 @@ module.exports = class LevelSession extends CocoModel completed: -> @get('state')?.complete || false + + shouldAvoidCorruptData: (attrs) -> + return false unless me.team is 'humans' + if _.string.startsWith (attrs?.code ? @get('code'))?.anya?.makeBid ? '', 'var __interceptThis' + noty text: "Not saving session--it's trying to overwrite Anya's code with transpiled output. Please let us know and help us reproduce this bug!", layout: 'topCenter', type: 'error', killer: false, timeout: 120000 + return true + false + + save: (attrs, options) -> + return if @shouldAvoidCorruptData attrs + super attrs, options diff --git a/app/views/play/SpectateView.coffee b/app/views/play/SpectateView.coffee index 8cd6a79cb..f4d7514ba 100644 --- a/app/views/play/SpectateView.coffee +++ b/app/views/play/SpectateView.coffee @@ -217,7 +217,7 @@ module.exports = class SpectateLevelView extends RootView initScriptManager: -> if @world.scripts nonVictoryPlaybackScripts = _.reject @world.scripts, (script) -> - script.id.indexOf('Set Camera Boundaries and Goals') == -1 + script.id.indexOf('Set Camera Boundaries') is -1 else console.log 'World scripts don\'t exist!' nonVictoryPlaybackScripts = []