summaryrefslogtreecommitdiff
path: root/worker.js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-04-12 15:25:22 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-04-12 15:25:22 +0200
commit6f142a3243f37bf0b732a87ebe8e92583daf3cff (patch)
treee26b643029c0efef840131655a1b698d94278065 /worker.js
parent8ce9983be962e364fcd9755a710b4543a67fe3ff (diff)
parent61aba3f4b552432dad20a3bf3765452a18dc15e3 (diff)
downloadshrinker-6f142a3243f37bf0b732a87ebe8e92583daf3cff.tar.gz
shrinker-6f142a3243f37bf0b732a87ebe8e92583daf3cff.zip
Merge branch 'release/2.0.0' of https://gitlab.com/vainglorygame/processor into release/2.0.0
Diffstat (limited to 'worker.js')
-rw-r--r--worker.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/worker.js b/worker.js
index 933e91c..0ada2a7 100644
--- a/worker.js
+++ b/worker.js
@@ -421,8 +421,7 @@ function snakeCaseKeys(obj) {
["api_id", "shard_id", "player_api_id", "roster_api_id",
"winner", "went_afk", "first_afk_time",
"skin_key", "skill_tier", "level",
- "karma_level", "actor",
- "farm"].map((attr) =>
+ "karma_level", "actor"].map((attr) =>
p[attr] = participant[attr]);
// attributes to copy from API to participant_stats
@@ -431,12 +430,12 @@ function snakeCaseKeys(obj) {
"jungle_kills", "non_jungle_minion_kills",
"crystal_mine_captures", "gold_mine_captures",
"kraken_captures", "turret_captures",
- "gold"].map((attr) =>
+ "gold", "farm"].map((attr) =>
p_s[attr] = participant[attr]);
// traits calculations
if (roster.hero_kills == 0) p_s.kill_participation = 0;
- else p_s.kill_participation = p_s.kills / roster.hero_kills;
+ else p_s.kill_participation = (p_s.kills + p_s.assists) / roster.hero_kills;
p_s.sustain_score = participant.items.reduce((score, item) => {
// items[], itemGrants{}, itemUse{}, itemSells{} are the API objects