Skip to content

Commit 51e9174

Browse files
committed
Merge pull request dsjoerg#15 from eric-hu/master
Display units in comparison graph for 1v1 AI
2 parents 167f77c + c9e3560 commit 51e9174

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

app/assets/javascripts/angular/resources/match.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ gg.factory('Match', ['$ggResource', '$compile', 'Matchnote', function($ggResourc
245245
this.entityIds = [];
246246
this.teams = {};
247247

248+
var twoPlayerMatch = this.playerCount === 2;
249+
248250
for(var ei in this.entities) {
249251
// console.log("ei", ei, this.armies_by_frame, this.entities, this.entities[ei].identity.name);
250252
if (this.armies_by_frame && this.entities[ei].identity) {
@@ -255,6 +257,8 @@ gg.factory('Match', ['$ggResource', '$compile', 'Matchnote', function($ggResourc
255257
} else if (this.entities[ei].identity.id in this.armies_by_frame) {
256258
entityArmy = this.armies_by_frame[this.entities[ei].identity.id];
257259
// console.log("got abf for ei by id", ei, entityArmy);
260+
} else if (this.entities[ei].identity.name.match(/A.I./) && twoPlayerMatch) {
261+
entityArmy = this.armies_by_frame[0];
258262
}
259263
this.entities[ei].armies_by_frame = entityArmy;
260264
}

spec/spec_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# SimpleCov is ..rcov for 1.9+
22
# https://github.com/colszowka/simplecov
33
require 'simplecov'
4-
SimpleCov.start
4+
SimpleCov.start do
5+
add_filter "/spec/"
6+
end
57

68
# This file is copied to spec/ when you run 'rails generate rspec:install'
79
ENV["RAILS_ENV"] ||= 'test'

0 commit comments

Comments
 (0)