Skip to content

Commit

Permalink
Fix infinity KDA
Browse files Browse the repository at this point in the history
  • Loading branch information
KwikKill committed Apr 29, 2024
1 parent 21167c2 commit 090d628
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions util/lol_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ module.exports = {
embed.addFields(
// KDA
{
name: ((last_game["kills"] + last_game["assists"]) / last_game["deaths"]).toFixed(2) + " KDA",
name: ((last_game["kills"] + last_game["assists"]) / (last_game["deaths"] || 1)).toFixed(2) + " KDA",
value: last_game["kills"] + "/" + last_game["deaths"] + "/" + last_game["assists"],
inline: true,
},
Expand All @@ -602,7 +602,7 @@ module.exports = {
embed.addFields(
// KDA
{
name: ((last_game["kills"] + last_game["assists"]) / last_game["deaths"]).toFixed(2) + " KDA",
name: ((last_game["kills"] + last_game["assists"]) / (last_game["deaths"] || 1)).toFixed(2) + " KDA",
value: last_game["kills"] + "/" + last_game["deaths"] + "/" + last_game["assists"],
inline: true,
},
Expand Down Expand Up @@ -632,7 +632,7 @@ module.exports = {
embed.addFields(
// KDA
{
name: ((last_game["kills"] + last_game["assists"]) / last_game["deaths"]).toFixed(2) + " KDA",
name: ((last_game["kills"] + last_game["assists"]) / (last_game["deaths"] || 1)).toFixed(2) + " KDA",
value: last_game["kills"] + "/" + last_game["deaths"] + "/" + last_game["assists"],
inline: true,
},
Expand Down Expand Up @@ -662,7 +662,7 @@ module.exports = {
embed.addFields(
// KDA
{
name: ((last_game["kills"] + last_game["assists"]) / last_game["deaths"]).toFixed(2) + " KDA",
name: ((last_game["kills"] + last_game["assists"]) / (last_game["deaths"] || 1)).toFixed(2) + " KDA",
value: last_game["kills"] + "/" + last_game["deaths"] + "/" + last_game["assists"],
inline: true,
},
Expand Down

0 comments on commit 090d628

Please sign in to comment.