Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2737 closed defect (invalid)

[PATCH] Statistics Tracker falsly tries to access its classes directly via an entity id.

Reported by: Radagast Owned by:
Priority: Must Have Milestone:
Component: UI & Simulation Keywords: bug, statistics tracker
Cc: Patch:

Description

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.

Attachments (1)

Change History (5)

comment:1 by mimo, 10 years ago

Keywords: review removed

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).

comment:2 by mimo, 10 years ago

In 15660:

improve comment, see #2737

comment:3 by mimo, 10 years ago

Keywords: patch removed
Resolution: invalid
Status: newclosed

comment:4 by leper, 10 years ago

Milestone: Backlog
Note: See TracTickets for help on using tickets.