diff --git a/app/views/play/level/tome/tome_view.coffee b/app/views/play/level/tome/tome_view.coffee index e4cacc120..558e8cdc4 100644 --- a/app/views/play/level/tome/tome_view.coffee +++ b/app/views/play/level/tome/tome_view.coffee @@ -55,10 +55,15 @@ module.exports = class TomeView extends View afterRender: -> super() programmableThangs = _.filter @options.thangs, 'isProgrammable' - @createSpells programmableThangs # Do before spellList, thangList, and castButton - @spellList = @insertSubView new SpellListView spells: @spells, supermodel: @supermodel - @thangList = @insertSubView new ThangListView spells: @spells, thangs: @options.thangs, supermodel: @supermodel - @castButton = @insertSubView new CastButtonView spells: @spells + + if programmableThangs.length + @createSpells programmableThangs # Do before spellList, thangList, and castButton + @spellList = @insertSubView new SpellListView spells: @spells, supermodel: @supermodel + @thangList = @insertSubView new ThangListView spells: @spells, thangs: @options.thangs, supermodel: @supermodel + @castButton = @insertSubView new CastButtonView spells: @spells + else + @cast() + console.log "Warning: There are no Programmable Thangs in this level, which makes it unplayable." createSpells: (programmableThangs) -> # If needed, we could make this able to update when programmableThangs changes.