From 36f342a47d2a03eec3482e70ccf9674f97417901 Mon Sep 17 00:00:00 2001 From: Baptiste Date: Thu, 28 Dec 2023 11:46:39 +0100 Subject: [PATCH] feat:Leaderboard n'affiche pas les death et ratio des non joueurs --- public_html/js/leaderboard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public_html/js/leaderboard.js b/public_html/js/leaderboard.js index 950cdfb..b01d1c2 100644 --- a/public_html/js/leaderboard.js +++ b/public_html/js/leaderboard.js @@ -52,8 +52,8 @@ class LeaderBoard { this.ctx.fillText((this.nbjoueur+1), this.px+10, this.py+120+20*this.nbjoueur); this.ctx.fillText(p.name, this.px+30, this.py+120+20*this.nbjoueur); this.ctx.fillText(p.kill, this.px+180, this.py+120+20*this.nbjoueur); - this.ctx.fillText(p.death, this.px+200, this.py+120+20*this.nbjoueur); - this.ctx.fillText(Math.round(10*p.kill/p.death)/10, this.px+220, this.py+120+20*this.nbjoueur); + this.ctx.fillText(p.id>0 ? p.death : "-", this.px+200, this.py+120+20*this.nbjoueur); + this.ctx.fillText(p.id>0 ? Math.round(10*p.kill/p.death)/10 : "-", this.px+220, this.py+120+20*this.nbjoueur); this.nbjoueur++; }