[PATCH] Statistics Tracker falsly tries to access its classes directly via an entity id.
149 /**
150 * Increments counter associated with certain entity/counter and type of given entity.
151 * @param entity The entity id
152 * @param counter The name of the counter to increment (e.g. "unitsTrained")
153 * @param type The type of the counter (e.g. "workers")
154 */
155 StatisticsTracker.prototype.CounterIncrement = function(entity, counter, type)
156 {
157 var classes = entity.GetClassesList();
158 if (!classes)
159 return;
160 if (classes.indexOf(type) != -1)
161 this[counter][type]++;
162 };
For a correction see the patch.
Looking at the code, the original one looks correct to me: each time CounterIncrement is called, the first argument is rightly the cmpIdentity of the entity. So it is only the comment line 151 which is misleading (and may-be also the name of this first argument should be changed).