From dd08a8bd64616db20a1b0313ce31e609f21d25bc Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Tue, 24 May 2016 13:54:49 -0700 Subject: [PATCH] Fix always using JavaScript for enemy AI in multiplayer --- app/views/play/level/tome/Spell.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/play/level/tome/Spell.coffee b/app/views/play/level/tome/Spell.coffee index 7cc6ace59..0e6642d67 100644 --- a/app/views/play/level/tome/Spell.coffee +++ b/app/views/play/level/tome/Spell.coffee @@ -31,8 +31,11 @@ module.exports = class Spell @languages.javascript ?= p.source @name = p.name @permissions = read: p.permissions?.read ? [], readwrite: p.permissions?.readwrite ? [] # teams + @team = @permissions.readwrite[0] ? 'common' if @canWrite() @setLanguage options.language + else if @otherSession and @team is @otherSession.get 'team' + @setLanguage @otherSession.get('submittedCodeLanguage') or @otherSession.get('codeLanguage') else @setLanguage 'javascript' @@ -49,7 +52,6 @@ module.exports = class Spell @view.render() # Get it ready and code loaded in advance @tabView = new SpellListTabEntryView spell: @, supermodel: @supermodel, codeLanguage: @language, level: options.level @tabView.render() - @team = @permissions.readwrite[0] ? 'common' Backbone.Mediator.publish 'tome:spell-created', spell: @ destroy: ->