diff --git a/app/assets/javascripts/angular/resources/match.js b/app/assets/javascripts/angular/resources/match.js index 7d51600..983948a 100644 --- a/app/assets/javascripts/angular/resources/match.js +++ b/app/assets/javascripts/angular/resources/match.js @@ -245,6 +245,8 @@ gg.factory('Match', ['$ggResource', '$compile', 'Matchnote', function($ggResourc this.entityIds = []; this.teams = {}; + var twoPlayerMatch = this.playerCount === 2; + for(var ei in this.entities) { // console.log("ei", ei, this.armies_by_frame, this.entities, this.entities[ei].identity.name); if (this.armies_by_frame && this.entities[ei].identity) { @@ -255,6 +257,8 @@ gg.factory('Match', ['$ggResource', '$compile', 'Matchnote', function($ggResourc } else if (this.entities[ei].identity.id in this.armies_by_frame) { entityArmy = this.armies_by_frame[this.entities[ei].identity.id]; // console.log("got abf for ei by id", ei, entityArmy); + } else if (this.entities[ei].identity.name.match(/A.I./) && twoPlayerMatch) { + entityArmy = this.armies_by_frame[0]; } this.entities[ei].armies_by_frame = entityArmy; } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a2df784..1db7861 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,9 @@ # SimpleCov is ..rcov for 1.9+ # https://github.com/colszowka/simplecov require 'simplecov' -SimpleCov.start +SimpleCov.start do + add_filter "/spec/" +end # This file is copied to spec/ when you run 'rails generate rspec:install' ENV["RAILS_ENV"] ||= 'test'