Skip to content

Commit 08fa391

Browse files
committed
Analytics: Support duplicated skills
In old logs, we can sometimes encounter a skill with the same id being defined again, in that case we just take the first definition
1 parent 569b9f7 commit 08fa391

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

EVTCAnalytics/LogProcessor.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,16 @@ private CombatItemData GetDataFromCombatItems(IEnumerable<Agent> agents, IEnumer
385385
ParsedLog log)
386386
{
387387
var agentsByAddress = agents.ToDictionary(x => x.Address);
388-
var skillsById = skills.ToDictionary(x => x.Id);
388+
var skillsById = new Dictionary<uint, Skill>();
389+
foreach (var skill in skills)
390+
{
391+
// Rarely, in old logs a skill may be duplicated (typically a skill with id 0),
392+
// so we only use the first definition
393+
if (!skillsById.ContainsKey(skill.Id))
394+
{
395+
skillsById.Add(skill.Id, skill);
396+
}
397+
}
389398

390399
var events = new List<Event>();
391400
LogTime startTime = null;

0 commit comments

Comments
 (0)