From 022cd2794360a15bae594d725b8fd6163a7f8e95 Mon Sep 17 00:00:00 2001 From: sBasalto Date: Wed, 13 Jul 2022 12:40:00 +0200 Subject: [PATCH] Fix zombie percent in round end summary The zombie percent should now be rounded properly when appearing in the round end summary as requested in issue #9642. --- Content.Server/GameTicking/Rules/ZombieRuleSystem.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs b/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs index aed7788b09e6..d42effa33417 100644 --- a/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs @@ -69,16 +69,16 @@ private void OnRoundEndText(RoundEndTextAppendEvent ev) return; //this is just the general condition thing used for determining the win/lose text - var percent = Math.Round(GetInfectedPercentage(out var livingHumans), 2); + var percent = GetInfectedPercentage(out var livingHumans); if (percent <= 0) ev.AddLine(Loc.GetString("zombie-round-end-amount-none")); else if (percent <= 0.25) ev.AddLine(Loc.GetString("zombie-round-end-amount-low")); else if (percent <= 0.5) - ev.AddLine(Loc.GetString("zombie-round-end-amount-medium", ("percent", (percent * 100).ToString()))); + ev.AddLine(Loc.GetString("zombie-round-end-amount-medium", ("percent", Math.Round((percent * 100), 2).ToString()))); else if (percent < 1) - ev.AddLine(Loc.GetString("zombie-round-end-amount-high", ("percent", (percent * 100).ToString()))); + ev.AddLine(Loc.GetString("zombie-round-end-amount-high", ("percent", Math.Round((percent * 100), 2).ToString()))); else ev.AddLine(Loc.GetString("zombie-round-end-amount-all"));