Skip to content

Commit 620103a

Browse files
committed
・デス数0の時、デス数を1として計算。
1 parent c9603be commit 620103a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/com/github/elic0de/thejpspit/util/KillRatingHelper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ private double calculateKillingRatio(PitPlayer player) {
2727
long deaths = player.getDeaths();
2828
long kills = player.getKills();
2929
long total = deaths + kills;
30+
if (deaths == 0) deaths++;
3031
if (deaths >= 0 && kills >= 0 && total > 0) {
3132
return round((double) kills / deaths * roundingFactor) / roundingFactor;
3233
} else {
@@ -38,6 +39,7 @@ private double calculateKillingRatio(OfflinePitPlayer player) {
3839
long deaths = player.getDeaths();
3940
long kills = player.getKills();
4041
long total = deaths + kills;
42+
if (deaths == 0) deaths++;
4143
if (deaths >= 0 && kills >= 0 && total > 0) {
4244
return round((double) kills / deaths * roundingFactor) / roundingFactor;
4345
} else {

0 commit comments

Comments
 (0)