summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-04-07 20:23:39 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-04-07 20:23:39 +0200
commit72165f52411deaf633a7d6c301f0650c94f79671 (patch)
tree29c2626e94eeaf8c483b29ebc18b2f5382e985a2
parent241a277b78d9b3f94ddee550e2d6e7f08fff2a95 (diff)
downloadcompiler-72165f52411deaf633a7d6c301f0650c94f79671.tar.gz
compiler-72165f52411deaf633a7d6c301f0650c94f79671.zip
fix NaN stat
-rw-r--r--worker.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/worker.js b/worker.js
index 5c1c5bf..84203ec 100644
--- a/worker.js
+++ b/worker.js
@@ -163,7 +163,8 @@ var RABBITMQ_URI = process.env.RABBITMQ_URI || "amqp://localhost",
participant_stats.kills = participant.get("kills");
- participant_stats.kill_participation = participant.get("kills") / participant.roster.get("hero_kills");
+ if (participant.roster.get("hero_kills") == 0) participant_stats.kill_participation = 0;
+ else participant_stats.kill_participation = participant.get("kills") / participant.roster.get("hero_kills");
return participant_stats;
}